mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Edit dates of multiple items
This commit is contained in:
@ -81,8 +81,10 @@ module Api exposing
|
||||
, setConfirmed
|
||||
, setCorrOrg
|
||||
, setCorrPerson
|
||||
, setDateMultiple
|
||||
, setDirection
|
||||
, setDirectionMultiple
|
||||
, setDueDateMultiple
|
||||
, setFolder
|
||||
, setFolderMultiple
|
||||
, setItemDate
|
||||
@ -135,6 +137,7 @@ import Api.Model.ItemLightList exposing (ItemLightList)
|
||||
import Api.Model.ItemProposals exposing (ItemProposals)
|
||||
import Api.Model.ItemSearch exposing (ItemSearch)
|
||||
import Api.Model.ItemUploadMeta exposing (ItemUploadMeta)
|
||||
import Api.Model.ItemsAndDate exposing (ItemsAndDate)
|
||||
import Api.Model.ItemsAndDirection exposing (ItemsAndDirection)
|
||||
import Api.Model.ItemsAndName exposing (ItemsAndName)
|
||||
import Api.Model.ItemsAndRef exposing (ItemsAndRef)
|
||||
@ -1344,6 +1347,34 @@ setDirectionMultiple flags data receive =
|
||||
}
|
||||
|
||||
|
||||
setDateMultiple :
|
||||
Flags
|
||||
-> ItemsAndDate
|
||||
-> (Result Http.Error BasicResult -> msg)
|
||||
-> Cmd msg
|
||||
setDateMultiple flags data receive =
|
||||
Http2.authPut
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/items/date"
|
||||
, account = getAccount flags
|
||||
, body = Http.jsonBody (Api.Model.ItemsAndDate.encode data)
|
||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||
}
|
||||
|
||||
|
||||
setDueDateMultiple :
|
||||
Flags
|
||||
-> ItemsAndDate
|
||||
-> (Result Http.Error BasicResult -> msg)
|
||||
-> Cmd msg
|
||||
setDueDateMultiple flags data receive =
|
||||
Http2.authPut
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/items/duedate"
|
||||
, account = getAccount flags
|
||||
, body = Http.jsonBody (Api.Model.ItemsAndDate.encode data)
|
||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||
}
|
||||
|
||||
|
||||
|
||||
--- Item
|
||||
|
||||
|
@ -6,6 +6,7 @@ module Comp.ItemDetail.FormChange exposing
|
||||
import Api
|
||||
import Api.Model.BasicResult exposing (BasicResult)
|
||||
import Api.Model.IdName exposing (IdName)
|
||||
import Api.Model.ItemsAndDate exposing (ItemsAndDate)
|
||||
import Api.Model.ItemsAndDirection exposing (ItemsAndDirection)
|
||||
import Api.Model.ItemsAndName exposing (ItemsAndName)
|
||||
import Api.Model.ItemsAndRef exposing (ItemsAndRef)
|
||||
@ -71,5 +72,19 @@ multiUpdate flags ids change receive =
|
||||
in
|
||||
Api.setDirectionMultiple flags data receive
|
||||
|
||||
ItemDateChange date ->
|
||||
let
|
||||
data =
|
||||
ItemsAndDate items date
|
||||
in
|
||||
Api.setDateMultiple flags data receive
|
||||
|
||||
DueDateChange date ->
|
||||
let
|
||||
data =
|
||||
ItemsAndDate items date
|
||||
in
|
||||
Api.setDueDateMultiple flags data receive
|
||||
|
||||
_ ->
|
||||
Cmd.none
|
||||
|
Reference in New Issue
Block a user