Return custom field values with search results

This commit is contained in:
Eike Kettner
2020-11-23 10:23:25 +01:00
parent 44459aecd0
commit 7b7f1e4d6d
3 changed files with 18 additions and 6 deletions

View File

@ -524,7 +524,8 @@ object QItem {
case class ListItemWithTags(
item: ListItem,
tags: List[RTag],
attachments: List[AttachmentLight]
attachments: List[AttachmentLight],
customfields: List[ItemFieldValue]
)
/** Same as `findItems` but resolves the tags for each item. Note that
@ -560,10 +561,12 @@ object QItem {
tags <- Stream.eval(tagItems.traverse(ti => findTag(resolvedTags, ti)))
attachs <- Stream.eval(findAttachmentLight(item.id))
ftags = tags.flatten.filter(t => t.collective == collective)
cfields <- Stream.eval(findCustomFieldValuesForItem(item.id))
} yield ListItemWithTags(
item,
ftags.toList.sortBy(_.name),
attachs.sortBy(_.position)
attachs.sortBy(_.position),
cfields.toList
)
}