Add route to create and associate correspondent org

This commit is contained in:
Eike Kettner
2020-06-11 22:04:08 +02:00
parent 459647f83f
commit c6accca0ff
3 changed files with 53 additions and 0 deletions

View File

@ -100,6 +100,14 @@ object ItemRoutes {
resp <- Ok(Conversions.basicResult(res, "Correspondent organization updated"))
} yield resp
case req @ POST -> Root / Ident(id) / "corrOrg" =>
for {
data <- req.as[Organization]
org <- Conversions.newOrg(data, user.account.collective)
res <- backend.item.addCorrOrg(id, org)
resp <- Ok(Conversions.basicResult(res, "Correspondent organization updated"))
} yield resp
case req @ PUT -> Root / Ident(id) / "corrPerson" =>
for {
idref <- req.as[OptionalId]