mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Add missing organization/person/equipment routes
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package docspell.restserver.routes
|
||||
|
||||
import cats.data.OptionT
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
@ -49,6 +50,12 @@ object EquipmentRoutes {
|
||||
del <- backend.equipment.delete(id, user.account.collective)
|
||||
resp <- Ok(basicResult(del, "Equipment deleted."))
|
||||
} yield resp
|
||||
|
||||
case GET -> Root / Ident(id) =>
|
||||
(for {
|
||||
equip <- OptionT(backend.equipment.find(user.account, id))
|
||||
resp <- OptionT.liftF(Ok(mkEquipment(equip)))
|
||||
} yield resp).getOrElseF(NotFound())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package docspell.restserver.routes
|
||||
|
||||
import cats.data.OptionT
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
@ -55,6 +56,12 @@ object OrganizationRoutes {
|
||||
delOrg <- backend.organization.deleteOrg(id, user.account.collective)
|
||||
resp <- Ok(basicResult(delOrg, "Organization deleted."))
|
||||
} yield resp
|
||||
|
||||
case GET -> Root / Ident(id) =>
|
||||
(for {
|
||||
org <- OptionT(backend.organization.findOrg(user.account, id))
|
||||
resp <- OptionT.liftF(Ok(mkOrg(org)))
|
||||
} yield resp).getOrElseF(NotFound())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package docspell.restserver.routes
|
||||
|
||||
import cats.data.OptionT
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
@ -59,6 +60,12 @@ object PersonRoutes {
|
||||
delOrg <- backend.organization.deletePerson(id, user.account.collective)
|
||||
resp <- Ok(basicResult(delOrg, "Person deleted."))
|
||||
} yield resp
|
||||
|
||||
case GET -> Root / Ident(id) =>
|
||||
(for {
|
||||
org <- OptionT(backend.organization.findPerson(user.account, id))
|
||||
resp <- OptionT.liftF(Ok(mkPerson(org)))
|
||||
} yield resp).getOrElseF(NotFound())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user