mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Edit direction of multiple items
This commit is contained in:
@ -94,12 +94,13 @@ object ItemMultiRoutes {
|
||||
resp <- Ok(Conversions.basicResult(res, "Folder updated"))
|
||||
} yield resp
|
||||
|
||||
// case req @ PUT -> Root / "direction" =>
|
||||
// for {
|
||||
// dir <- req.as[DirectionValue]
|
||||
// res <- backend.item.setDirection(id, dir.direction, user.account.collective)
|
||||
// resp <- Ok(Conversions.basicResult(res, "Direction updated"))
|
||||
// } yield resp
|
||||
case req @ PUT -> Root / "direction" =>
|
||||
for {
|
||||
json <- req.as[ItemsAndDirection]
|
||||
items <- readIds[F](json.items)
|
||||
res <- backend.item.setDirection(items, json.direction, user.account.collective)
|
||||
resp <- Ok(Conversions.basicResult(res, "Direction updated"))
|
||||
} yield resp
|
||||
|
||||
// case req @ PUT -> Root / "corrOrg" =>
|
||||
// for {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package docspell.restserver.routes
|
||||
|
||||
import cats.data.NonEmptyList
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
@ -165,8 +166,12 @@ object ItemRoutes {
|
||||
|
||||
case req @ PUT -> Root / Ident(id) / "direction" =>
|
||||
for {
|
||||
dir <- req.as[DirectionValue]
|
||||
res <- backend.item.setDirection(id, dir.direction, user.account.collective)
|
||||
dir <- req.as[DirectionValue]
|
||||
res <- backend.item.setDirection(
|
||||
NonEmptyList.of(id),
|
||||
dir.direction,
|
||||
user.account.collective
|
||||
)
|
||||
resp <- Ok(Conversions.basicResult(res, "Direction updated"))
|
||||
} yield resp
|
||||
|
||||
|
Reference in New Issue
Block a user