Refactor findItemsWithTags to more general useful

This commit is contained in:
Eike Kettner
2020-06-23 21:27:01 +02:00
parent 647911563e
commit d9f0f05613
4 changed files with 24 additions and 8 deletions

View File

@ -110,11 +110,15 @@ object OItemSearch {
.compile
.toVector
def findItemsWithTags(q: Query, batch: Batch): F[Vector[ListItemWithTags]] =
def findItemsWithTags(q: Query, batch: Batch): F[Vector[ListItemWithTags]] = {
val search = QItem.findItems(q, batch)
store
.transact(QItem.findItemsWithTags(q, batch).take(batch.limit.toLong))
.transact(
QItem.findItemsWithTags(q.collective, search).take(batch.limit.toLong)
)
.compile
.toVector
}
def findAttachment(id: Ident, collective: Ident): F[Option[AttachmentData[F]]] =
store