From 7b3625eeeba14525e3b47546c69a790875fa0993 Mon Sep 17 00:00:00 2001 From: soxa <6390896+Soxasora@users.noreply.github.com> Date: Sun, 6 Jul 2025 19:11:55 +0200 Subject: [PATCH] fix: outlawed comments should appear at the bottom (#2246) --- api/resolvers/item.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index de46f2f2..8f3ebc60 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -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') {