mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
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:
@ -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 {
|
||||
|
@ -75,9 +75,10 @@ object ExprUtil {
|
||||
expr
|
||||
case AttachId(_) =>
|
||||
expr
|
||||
|
||||
case ValidItemStates =>
|
||||
expr
|
||||
case Trashed =>
|
||||
expr
|
||||
}
|
||||
|
||||
private def spliceAnd(nodes: Nel[Expr]): Nel[Expr] =
|
||||
|
Reference in New Issue
Block a user