mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Allow tag ids or tag names when replacing tags
This commit is contained in:
@ -59,9 +59,12 @@ object ItemMultiRoutes extends MultiIdSupport {
|
||||
for {
|
||||
json <- req.as[ItemsAndRefs]
|
||||
items <- readIds[F](json.items)
|
||||
tags <- json.refs.traverse(readId[F])
|
||||
res <- backend.item.setTagsMultipleItems(items, tags, user.account.collective)
|
||||
resp <- Ok(Conversions.basicResult(res, "Tags updated"))
|
||||
res <- backend.item.setTagsMultipleItems(
|
||||
items,
|
||||
json.refs,
|
||||
user.account.collective
|
||||
)
|
||||
resp <- Ok(Conversions.basicResult(res, "Tags updated"))
|
||||
} yield resp
|
||||
|
||||
case req @ POST -> Root / "tags" =>
|
||||
|
@ -146,8 +146,8 @@ object ItemRoutes {
|
||||
|
||||
case req @ PUT -> Root / Ident(id) / "tags" =>
|
||||
for {
|
||||
tags <- req.as[ReferenceList].map(_.items)
|
||||
res <- backend.item.setTags(id, tags.map(_.id), user.account.collective)
|
||||
tags <- req.as[StringList].map(_.items)
|
||||
res <- backend.item.setTags(id, tags, user.account.collective)
|
||||
resp <- Ok(Conversions.basicResult(res, "Tags updated"))
|
||||
} yield resp
|
||||
|
||||
|
Reference in New Issue
Block a user