mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 02:48:26 +00:00
Allow to search in deleted items
This commit is contained in:
@ -21,6 +21,7 @@ module Data.ItemQuery exposing
|
||||
import Api.Model.CustomFieldValue exposing (CustomFieldValue)
|
||||
import Api.Model.ItemQuery as RQ
|
||||
import Data.Direction exposing (Direction)
|
||||
import Data.SearchMode exposing (SearchMode)
|
||||
|
||||
|
||||
type TagMatch
|
||||
@ -73,13 +74,13 @@ and list =
|
||||
Just (And es)
|
||||
|
||||
|
||||
request : Maybe ItemQuery -> RQ.ItemQuery
|
||||
request mq =
|
||||
request : SearchMode -> Maybe ItemQuery -> RQ.ItemQuery
|
||||
request smode mq =
|
||||
{ offset = Nothing
|
||||
, limit = Nothing
|
||||
, withDetails = Just True
|
||||
, query = renderMaybe mq
|
||||
, searchMode = Nothing
|
||||
, searchMode = Data.SearchMode.asString smode |> Just
|
||||
}
|
||||
|
||||
|
||||
|
40
modules/webapp/src/main/elm/Data/SearchMode.elm
Normal file
40
modules/webapp/src/main/elm/Data/SearchMode.elm
Normal file
@ -0,0 +1,40 @@
|
||||
{-
|
||||
Copyright 2020 Docspell Contributors
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-}
|
||||
|
||||
|
||||
module Data.SearchMode exposing
|
||||
( SearchMode(..)
|
||||
, asString
|
||||
, fromString
|
||||
)
|
||||
|
||||
|
||||
type SearchMode
|
||||
= Normal
|
||||
| Trashed
|
||||
|
||||
|
||||
fromString : String -> Maybe SearchMode
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
"normal" ->
|
||||
Just Normal
|
||||
|
||||
"trashed" ->
|
||||
Just Trashed
|
||||
|
||||
_ ->
|
||||
Nothing
|
||||
|
||||
|
||||
asString : SearchMode -> String
|
||||
asString smode =
|
||||
case smode of
|
||||
Normal ->
|
||||
"normal"
|
||||
|
||||
Trashed ->
|
||||
"trashed"
|
Reference in New Issue
Block a user