Allow to search in soft-deleted items

A new query/request parameter can be used to apply a search to only
soft-deleted items.

The query expression `Trashed` has been introduced which selects only
items with state `Deleted`. This is another option an analog to
`ValidItemStates` (both cannot be used together as they would select
no items). This new query node is not added to the parser, because
users may not use it in their own queries - it must be part of the
"fixed" query so the application can control in which subset to search
(it would otherwise be possible to select any items).
This commit is contained in:
eikek
2021-08-14 14:53:05 +02:00
parent cb777e30c0
commit a7b74bd5ae
8 changed files with 62 additions and 21 deletions

View File

@ -125,7 +125,8 @@ object ItemQuery {
final case class ChecksumMatch(checksum: String) extends Expr
final case class AttachId(id: String) extends Expr
case object ValidItemStates extends Expr
final case object ValidItemStates extends Expr
final case object Trashed extends Expr
// things that can be expressed with terms above
sealed trait MacroExpr extends Expr {

View File

@ -75,9 +75,10 @@ object ExprUtil {
expr
case AttachId(_) =>
expr
case ValidItemStates =>
expr
case Trashed =>
expr
}
private def spliceAnd(nodes: Nel[Expr]): Nel[Expr] =