mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix recommendations not fetched in search results
This commit is contained in:
parent
9c723ecbd3
commit
47510c0785
1 changed files with 6 additions and 4 deletions
|
|
@ -245,10 +245,7 @@ const buildWhereClause = (
|
|||
}
|
||||
|
||||
if (args.recommendedBy) {
|
||||
queryBuilder
|
||||
.innerJoin('library_item.recommendations', 'recommendations')
|
||||
.innerJoin('recommendations.recommender', 'recommender')
|
||||
.innerJoin('recommendations.group', 'group')
|
||||
queryBuilder.andWhere('recommendations IS NOT NULL')
|
||||
|
||||
// select all if * is provided
|
||||
if (args.recommendedBy !== '*') {
|
||||
|
|
@ -282,6 +279,11 @@ export const searchLibraryItems = async (
|
|||
.leftJoinAndSelect('library_item.highlights', 'highlights')
|
||||
.leftJoinAndSelect('highlights.user', 'user')
|
||||
.leftJoinAndSelect('user.profile', 'profile')
|
||||
.leftJoinAndSelect('library_item.recommendations', 'recommendations')
|
||||
.leftJoinAndSelect('recommendations.recommender', 'recommender')
|
||||
.leftJoinAndSelect('recommendations.group', 'group')
|
||||
.leftJoinAndSelect('recommender.profile', 'recommender_profile')
|
||||
.where('library_item.user_id = :userId', { userId })
|
||||
|
||||
// build the where clause
|
||||
buildWhereClause(queryBuilder, args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue