mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 18:38:26 +00:00
Delete multiple items
This commit is contained in:
@ -15,6 +15,7 @@ module Api exposing
|
||||
, createNewFolder
|
||||
, createNotifyDueItems
|
||||
, createScanMailbox
|
||||
, deleteAllItems
|
||||
, deleteAttachment
|
||||
, deleteEquip
|
||||
, deleteFolder
|
||||
@ -130,6 +131,7 @@ import Api.Model.EquipmentList exposing (EquipmentList)
|
||||
import Api.Model.FolderDetail exposing (FolderDetail)
|
||||
import Api.Model.FolderList exposing (FolderList)
|
||||
import Api.Model.GenInvite exposing (GenInvite)
|
||||
import Api.Model.IdList exposing (IdList)
|
||||
import Api.Model.IdResult exposing (IdResult)
|
||||
import Api.Model.ImapSettings exposing (ImapSettings)
|
||||
import Api.Model.ImapSettingsList exposing (ImapSettingsList)
|
||||
@ -182,6 +184,7 @@ import Data.Priority exposing (Priority)
|
||||
import File exposing (File)
|
||||
import Http
|
||||
import Json.Encode as JsonEncode
|
||||
import Set exposing (Set)
|
||||
import Task
|
||||
import Url
|
||||
import Util.File
|
||||
@ -1435,6 +1438,20 @@ setConcEquipmentMultiple flags data receive =
|
||||
}
|
||||
|
||||
|
||||
deleteAllItems :
|
||||
Flags
|
||||
-> Set String
|
||||
-> (Result Http.Error BasicResult -> msg)
|
||||
-> Cmd msg
|
||||
deleteAllItems flags ids receive =
|
||||
Http2.authPost
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/items/deleteAll"
|
||||
, account = getAccount flags
|
||||
, body = Http.jsonBody (Api.Model.IdList.encode (IdList (Set.toList ids)))
|
||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||
}
|
||||
|
||||
|
||||
|
||||
--- Item
|
||||
|
||||
|
Reference in New Issue
Block a user