mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-05 19:09:32 +00:00
Merge pull request #1328 from eikek/fix-routes
Reordered some routes due to a change in http4s
This commit is contained in:
commit
f23d19afb8
@ -30,6 +30,13 @@ object CollectiveRoutes {
|
||||
import dsl._
|
||||
|
||||
HttpRoutes.of {
|
||||
case GET -> Root =>
|
||||
for {
|
||||
collDb <- backend.collective.find(user.account.collective)
|
||||
coll = collDb.map(c => Collective(c.id, c.state, c.created))
|
||||
resp <- coll.toResponse()
|
||||
} yield resp
|
||||
|
||||
case GET -> Root / "insights" =>
|
||||
for {
|
||||
ins <- backend.collective.insights(user.account.collective)
|
||||
@ -122,13 +129,6 @@ object CollectiveRoutes {
|
||||
)
|
||||
resp <- Ok(BasicResult(true, "Task submitted"))
|
||||
} yield resp
|
||||
|
||||
case GET -> Root =>
|
||||
for {
|
||||
collDb <- backend.collective.find(user.account.collective)
|
||||
coll = collDb.map(c => Collective(c.id, c.state, c.created))
|
||||
resp <- coll.toResponse()
|
||||
} yield resp
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,13 @@ object NotifyDueItemsRoutes extends MailAddressCodec with NonEmptyListSupport {
|
||||
import dsl._
|
||||
|
||||
HttpRoutes.of {
|
||||
case GET -> Root =>
|
||||
ut.getNotifyDueItems(UserTaskScope(user.account))
|
||||
.evalMap(task => taskToSettings(backend, task))
|
||||
.compile
|
||||
.toVector
|
||||
.flatMap(Ok(_))
|
||||
|
||||
case GET -> Root / Ident(id) =>
|
||||
(for {
|
||||
task <- ut.findNotifyDueItems(id, UserTaskScope(user.account))
|
||||
@ -94,13 +101,6 @@ object NotifyDueItemsRoutes extends MailAddressCodec with NonEmptyListSupport {
|
||||
.map(Conversions.basicResult(_, "Saved successfully."))
|
||||
resp <- Ok(res)
|
||||
} yield resp
|
||||
|
||||
case GET -> Root =>
|
||||
ut.getNotifyDueItems(UserTaskScope(user.account))
|
||||
.evalMap(task => taskToSettings(backend, task))
|
||||
.compile
|
||||
.toVector
|
||||
.flatMap(Ok(_))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,14 @@ object PeriodicQueryRoutes extends MailAddressCodec with NonEmptyListSupport {
|
||||
val ut = backend.userTask
|
||||
import dsl._
|
||||
|
||||
HttpRoutes.of {
|
||||
HttpRoutes.strict {
|
||||
case GET -> Root =>
|
||||
ut.getPeriodicQuery(UserTaskScope(user.account))
|
||||
.evalMap(task => taskToSettings(task))
|
||||
.compile
|
||||
.toVector
|
||||
.flatMap(Ok(_))
|
||||
|
||||
case GET -> Root / Ident(id) =>
|
||||
(for {
|
||||
task <- ut.findPeriodicQuery(id, UserTaskScope(user.account))
|
||||
@ -96,12 +103,6 @@ object PeriodicQueryRoutes extends MailAddressCodec with NonEmptyListSupport {
|
||||
resp <- Ok(res)
|
||||
} yield resp
|
||||
|
||||
case GET -> Root =>
|
||||
ut.getPeriodicQuery(UserTaskScope(user.account))
|
||||
.evalMap(task => taskToSettings(task))
|
||||
.compile
|
||||
.toVector
|
||||
.flatMap(Ok(_))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,14 @@ object ScanMailboxRoutes {
|
||||
import dsl._
|
||||
|
||||
HttpRoutes.of {
|
||||
case GET -> Root =>
|
||||
ut.getScanMailbox(UserTaskScope(user.account))
|
||||
.evalMap(task => taskToSettings(user.account, backend, task))
|
||||
.compile
|
||||
.toVector
|
||||
.map(v => ScanMailboxSettingsList(v.toList))
|
||||
.flatMap(Ok(_))
|
||||
|
||||
case GET -> Root / Ident(id) =>
|
||||
(for {
|
||||
task <- ut.findScanMailbox(id, UserTaskScope(user.account))
|
||||
@ -89,14 +97,6 @@ object ScanMailboxRoutes {
|
||||
.map(Conversions.basicResult(_, "Saved successfully."))
|
||||
resp <- Ok(res)
|
||||
} yield resp
|
||||
|
||||
case GET -> Root =>
|
||||
ut.getScanMailbox(UserTaskScope(user.account))
|
||||
.evalMap(task => taskToSettings(user.account, backend, task))
|
||||
.compile
|
||||
.toVector
|
||||
.map(v => ScanMailboxSettingsList(v.toList))
|
||||
.flatMap(Ok(_))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user