mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Allow to restore deleted items in webui
This commit is contained in:
@ -99,6 +99,8 @@ module Api exposing
|
||||
, removeTagsMultiple
|
||||
, reprocessItem
|
||||
, reprocessMultiple
|
||||
, restoreAllItems
|
||||
, restoreItem
|
||||
, saveClientSettings
|
||||
, sendMail
|
||||
, setAttachmentName
|
||||
@ -1676,6 +1678,20 @@ deleteAllItems flags ids receive =
|
||||
}
|
||||
|
||||
|
||||
restoreAllItems :
|
||||
Flags
|
||||
-> Set String
|
||||
-> (Result Http.Error BasicResult -> msg)
|
||||
-> Cmd msg
|
||||
restoreAllItems flags ids receive =
|
||||
Http2.authPost
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/items/restoreAll"
|
||||
, account = getAccount flags
|
||||
, body = Http.jsonBody (Api.Model.IdList.encode (IdList (Set.toList ids)))
|
||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||
}
|
||||
|
||||
|
||||
|
||||
--- Item
|
||||
|
||||
@ -1973,6 +1989,16 @@ setUnconfirmed flags item receive =
|
||||
}
|
||||
|
||||
|
||||
restoreItem : Flags -> String -> (Result Http.Error BasicResult -> msg) -> Cmd msg
|
||||
restoreItem flags item receive =
|
||||
Http2.authPost
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/" ++ item ++ "/restore"
|
||||
, account = getAccount flags
|
||||
, body = Http.emptyBody
|
||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||
}
|
||||
|
||||
|
||||
deleteItem : Flags -> String -> (Result Http.Error BasicResult -> msg) -> Cmd msg
|
||||
deleteItem flags item receive =
|
||||
Http2.authDelete
|
||||
|
Reference in New Issue
Block a user