Skip to content

Commit 7b3625e

Browse files
authored
fix: outlawed comments should appear at the bottom (#2246)
1 parent 1eea0a3 commit 7b3625e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/resolvers/item.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ function commentsOrderByClause (me, models, sort) {
3434
const sharedSortsArray = []
3535
sharedSortsArray.push('("Item"."pinId" IS NOT NULL) DESC')
3636
sharedSortsArray.push('("Item"."deletedAt" IS NULL) DESC')
37+
// outlawed items should be at the bottom
38+
sharedSortsArray.push(`NOT ("Item"."weightedVotes" - "Item"."weightedDownVotes" <= -${ITEM_FILTER_THRESHOLD} OR "Item".outlawed) DESC`)
3739
const sharedSorts = sharedSortsArray.join(', ')
3840

3941
if (sort === 'recent') {

0 commit comments

Comments
 (0)