Allow to change position of attachments

This commit is contained in:
Eike Kettner
2020-05-24 17:29:28 +02:00
parent 6807ce4d2f
commit 3cb738568f
6 changed files with 123 additions and 1 deletions

View File

@ -137,6 +137,14 @@ object ItemRoutes {
resp <- Ok(ip)
} yield resp
case req @ POST -> Root / Ident(id) / "attachment" / "movebefore" =>
for {
data <- req.as[MoveAttachment]
_ <- logger.fdebug(s"Move item (${id.id}) attachment $data")
res <- backend.item.moveAttachmentBefore(id, data.source, data.target)
resp <- Ok(Conversions.basicResult(res, "Attachment moved."))
} yield resp
case DELETE -> Root / Ident(id) =>
for {
n <- backend.item.deleteItem(id, user.account.collective)