Skip to content

Commit

Permalink
fix: add missing feed id to filters query (#2561)
Browse files Browse the repository at this point in the history
  • Loading branch information
idoshamun authored Dec 21, 2024
1 parent 66ae35a commit 4b6970b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/common/feedGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ const getRawFiltersData = async (
.select(['"keywordId"', 'status'])
.from(ContentPreference, 't')
.where('"feedId" = $1')
.andWhere(`type = '${ContentPreferenceType.Keyword}'`)
.andWhere('"userId" = $2'),
.andWhere('"userId" = $2')
.andWhere(`type = '${ContentPreferenceType.Keyword}'`),
),
rawFilterSelect(con, 'users', (qb) =>
qb
.select('"referenceId"')
.from(ContentPreference, 'u')
.where('"feedId" = $1')
.andWhere('"userId" = $2')
.andWhere(`type = '${ContentPreferenceType.User}'`)
.andWhere(`status != '${ContentPreferenceStatus.Blocked}'`),
Expand All @@ -147,17 +148,17 @@ const getRawFiltersData = async (
.select(['"sourceId"', 'status'])
.from(ContentPreference, 't')
.where('"feedId" = $1')
.andWhere(`type = '${ContentPreferenceType.Source}'`)
.andWhere('"userId" = $2'),
.andWhere('"userId" = $2')
.andWhere(`type = '${ContentPreferenceType.Source}'`),
),
rawFilterSelect(con, 'words', (qb) =>
qb
.select(['"referenceId"'])
.from(ContentPreference, 'w')
.where('"feedId" = $1')
.andWhere('"userId" = $2')
.andWhere(`type = '${ContentPreferenceType.Word}'`)
.andWhere(`status = '${ContentPreferenceStatus.Blocked}'`)
.andWhere('"userId" = $2'),
.andWhere(`status = '${ContentPreferenceStatus.Blocked}'`),
),
rawFilterSelect(con, 'memberships', (qb) =>
qb
Expand Down

0 comments on commit 4b6970b

Please sign in to comment.