Add a task implementation to delete items

This commit is contained in:
eikek
2021-08-14 19:31:36 +02:00
parent 4901276c66
commit 50706c3d6d
5 changed files with 104 additions and 12 deletions

View File

@ -23,6 +23,8 @@ import doobie.implicits._
trait OItemSearch[F[_]] {
def findItem(id: Ident, collective: Ident): F[Option[ItemData]]
def findDeleted(collective: Ident, limit: Int): F[Vector[RItem]]
def findItems(maxNoteLen: Int)(q: Query, batch: Batch): F[Vector[ListItem]]
/** Same as `findItems` but does more queries per item to find all tags. */
@ -145,6 +147,13 @@ object OItemSearch {
.toVector
}
def findDeleted(collective: Ident, limit: Int): F[Vector[RItem]] =
store
.transact(RItem.findDeleted(collective, limit))
.take(limit.toLong)
.compile
.toVector
def findItemsWithTags(
maxNoteLen: Int
)(q: Query, batch: Batch): F[Vector[ListItemWithTags]] =