Start converting QItem

This commit is contained in:
Eike Kettner
2020-12-13 22:56:19 +01:00
parent a355767fdb
commit 35c62049f5
10 changed files with 170 additions and 160 deletions

View File

@ -121,7 +121,7 @@ object CreateItem {
private def findExisting[F[_]: Sync]: Task[F, ProcessItemArgs, Option[ItemData]] =
Task { ctx =>
val states = ItemState.invalidStates.toList.toSet
val states = ItemState.invalidStates
val fileMetaIds = ctx.args.files.map(_.fileMetaId).toSet
for {
cand <- ctx.store.transact(QItem.findByFileIds(fileMetaIds.toSeq, states))

View File

@ -105,7 +105,7 @@ object ItemHandler {
private def deleteByFileIds[F[_]: Sync: ContextShift]: Task[F, Args, Unit] =
Task { ctx =>
val states = ItemState.invalidStates.toList.toSet
val states = ItemState.invalidStates
for {
items <- ctx.store.transact(
QItem.findByFileIds(ctx.args.files.map(_.fileMetaId), states)