Add a route to add a new tag and associate it to an item

This commit is contained in:
Eike Kettner
2020-06-10 00:25:24 +02:00
parent d440247857
commit f407f08ed3
3 changed files with 255 additions and 194 deletions

View File

@ -78,6 +78,14 @@ object ItemRoutes {
resp <- Ok(Conversions.basicResult(res, "Tags updated"))
} yield resp
case req @ POST -> Root / Ident(id) / "tags" =>
for {
data <- req.as[Tag]
rtag <- Conversions.newTag(data, user.account.collective)
res <- backend.item.addNewTag(id, rtag)
resp <- Ok(Conversions.basicResult(res, "Tag added."))
} yield resp
case req @ PUT -> Root / Ident(id) / "direction" =>
for {
dir <- req.as[DirectionValue]