mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Edit folder of multiple items
This commit is contained in:
@ -83,6 +83,7 @@ module Api exposing
|
||||
, setCorrPerson
|
||||
, setDirection
|
||||
, setFolder
|
||||
, setFolderMultiple
|
||||
, setItemDate
|
||||
, setItemDueDate
|
||||
, setItemName
|
||||
@ -134,6 +135,7 @@ import Api.Model.ItemProposals exposing (ItemProposals)
|
||||
import Api.Model.ItemSearch exposing (ItemSearch)
|
||||
import Api.Model.ItemUploadMeta exposing (ItemUploadMeta)
|
||||
import Api.Model.ItemsAndName exposing (ItemsAndName)
|
||||
import Api.Model.ItemsAndRef exposing (ItemsAndRef)
|
||||
import Api.Model.ItemsAndRefs exposing (ItemsAndRefs)
|
||||
import Api.Model.JobPriority exposing (JobPriority)
|
||||
import Api.Model.JobQueueState exposing (JobQueueState)
|
||||
@ -1312,6 +1314,20 @@ setNameMultiple flags data receive =
|
||||
}
|
||||
|
||||
|
||||
setFolderMultiple :
|
||||
Flags
|
||||
-> ItemsAndRef
|
||||
-> (Result Http.Error BasicResult -> msg)
|
||||
-> Cmd msg
|
||||
setFolderMultiple flags data receive =
|
||||
Http2.authPut
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/items/folder"
|
||||
, account = getAccount flags
|
||||
, body = Http.jsonBody (Api.Model.ItemsAndRef.encode data)
|
||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||
}
|
||||
|
||||
|
||||
|
||||
--- Item
|
||||
|
||||
|
@ -7,6 +7,7 @@ import Api
|
||||
import Api.Model.BasicResult exposing (BasicResult)
|
||||
import Api.Model.IdName exposing (IdName)
|
||||
import Api.Model.ItemsAndName exposing (ItemsAndName)
|
||||
import Api.Model.ItemsAndRef exposing (ItemsAndRef)
|
||||
import Api.Model.ItemsAndRefs exposing (ItemsAndRefs)
|
||||
import Api.Model.ReferenceList exposing (ReferenceList)
|
||||
import Data.Direction exposing (Direction)
|
||||
@ -55,5 +56,12 @@ multiUpdate flags ids change receive =
|
||||
in
|
||||
Api.setNameMultiple flags data receive
|
||||
|
||||
FolderChange id ->
|
||||
let
|
||||
data =
|
||||
ItemsAndRef items (Maybe.map .id id)
|
||||
in
|
||||
Api.setFolderMultiple flags data receive
|
||||
|
||||
_ ->
|
||||
Cmd.none
|
||||
|
Reference in New Issue
Block a user