fix: outlawed comments should appear at the bottom (#2246)

This commit is contained in:
soxa 2025-07-06 19:11:55 +02:00 committed by GitHub
parent 1eea0a3ae0
commit 7b3625eeeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,8 @@ function commentsOrderByClause (me, models, sort) {
const sharedSortsArray = []
sharedSortsArray.push('("Item"."pinId" IS NOT NULL) DESC')
sharedSortsArray.push('("Item"."deletedAt" IS NULL) DESC')
// outlawed items should be at the bottom
sharedSortsArray.push(`NOT ("Item"."weightedVotes" - "Item"."weightedDownVotes" <= -${ITEM_FILTER_THRESHOLD} OR "Item".outlawed) DESC`)
const sharedSorts = sharedSortsArray.join(', ')
if (sort === 'recent') {