Skip to content

Commit

Permalink
fix precedence of op for not full hot sort (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
huumn authored Nov 9, 2024
1 parent d06f4ae commit c31cf97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/resolvers/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ const orderByClause = (by, me, models, type) => {
}

export function orderByNumerator ({ models, commentScaler = 0.5, considerBoost = false }) {
return `(CASE WHEN "Item"."weightedVotes" - "Item"."weightedDownVotes" > 0 THEN
return `((CASE WHEN "Item"."weightedVotes" - "Item"."weightedDownVotes" > 0 THEN
GREATEST("Item"."weightedVotes" - "Item"."weightedDownVotes", POWER("Item"."weightedVotes" - "Item"."weightedDownVotes", 1.2))
ELSE
"Item"."weightedVotes" - "Item"."weightedDownVotes"
END + "Item"."weightedComments"*${commentScaler}) + ${considerBoost ? `("Item".boost / ${BOOST_MULT})` : 0}`
END + "Item"."weightedComments"*${commentScaler}) + ${considerBoost ? `("Item".boost / ${BOOST_MULT})` : 0})`
}

export function joinZapRankPersonalView (me, models) {
Expand Down

0 comments on commit c31cf97

Please sign in to comment.