Add correspondent organizations in item edit view

This commit is contained in:
Eike Kettner
2020-06-11 22:10:48 +02:00
parent c6accca0ff
commit a4d60c0d92
3 changed files with 43 additions and 1 deletions

View File

@ -1,5 +1,6 @@
module Api exposing
( addTag
( addCorrOrg
, addTag
, cancelJob
, changePassword
, checkCalEvent
@ -1086,6 +1087,16 @@ setCorrOrg flags item id receive =
}
addCorrOrg : Flags -> String -> Organization -> (Result Http.Error BasicResult -> msg) -> Cmd msg
addCorrOrg flags item org receive =
Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/" ++ item ++ "/corrOrg"
, account = getAccount flags
, body = Http.jsonBody (Api.Model.Organization.encode org)
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
}
setCorrPerson : Flags -> String -> OptionalId -> (Result Http.Error BasicResult -> msg) -> Cmd msg
setCorrPerson flags item id receive =
Http2.authPut