Edit dates of multiple items

This commit is contained in:
Eike Kettner
2020-10-26 13:16:03 +01:00
parent 7ade7dd70b
commit 2e6026b817
7 changed files with 121 additions and 50 deletions

View File

@ -1,5 +1,6 @@
package docspell.joex.process
import cats.data.NonEmptyList
import cats.effect.Sync
import cats.implicits._
@ -88,7 +89,11 @@ object LinkProposal {
val ts = Timestamp.from(ld.atStartOfDay(Timestamp.UTC))
ctx.logger.debug(s"Updating item date ${value.id}") *>
ctx.store.transact(
RItem.updateDate(itemId, ctx.args.meta.collective, Some(ts))
RItem.updateDate(
NonEmptyList.of(itemId),
ctx.args.meta.collective,
Some(ts)
)
)
case None =>
ctx.logger.info(s"Cannot read value '${value.id}' into a date.") *>
@ -100,7 +105,11 @@ object LinkProposal {
val ts = Timestamp.from(ld.atStartOfDay(Timestamp.UTC))
ctx.logger.debug(s"Updating item due-date suggestion ${value.id}") *>
ctx.store.transact(
RItem.updateDueDate(itemId, ctx.args.meta.collective, Some(ts))
RItem.updateDueDate(
NonEmptyList.of(itemId),
ctx.args.meta.collective,
Some(ts)
)
)
case None =>
ctx.logger.info(s"Cannot read value '${value.id}' into a date.") *>