Toggle tags via drag-drop from list view

This commit is contained in:
Eike Kettner
2020-08-08 15:50:54 +02:00
parent 06ad9ac46c
commit 000d1aff2b
3 changed files with 16 additions and 16 deletions

View File

@ -92,6 +92,7 @@ module Api exposing
, startOnceScanMailbox
, startReIndex
, submitNotifyDueItems
, toggleTags
, updateNotifyDueItems
, updateScanMailbox
, upload
@ -148,6 +149,7 @@ import Api.Model.SentMails exposing (SentMails)
import Api.Model.SimpleMail exposing (SimpleMail)
import Api.Model.Source exposing (Source)
import Api.Model.SourceList exposing (SourceList)
import Api.Model.StringList exposing (StringList)
import Api.Model.Tag exposing (Tag)
import Api.Model.TagCloud exposing (TagCloud)
import Api.Model.TagList exposing (TagList)
@ -1304,6 +1306,16 @@ setTags flags item tags receive =
}
toggleTags : Flags -> String -> StringList -> (Result Http.Error BasicResult -> msg) -> Cmd msg
toggleTags flags item tags receive =
Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/" ++ item ++ "/tagtoggle"
, account = getAccount flags
, body = Http.jsonBody (Api.Model.StringList.encode tags)
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
}
addTag : Flags -> String -> Tag -> (Result Http.Error BasicResult -> msg) -> Cmd msg
addTag flags item tag receive =
Http2.authPost