This commit is contained in:
k00b 2024-12-27 19:06:30 -06:00
parent eb22fdab41
commit 74f771adf4
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@ export async function onPaid ({ invoice, id }, context) {
), ancestors AS (
UPDATE "Item"
SET ncomments = "Item".ncomments + 1,
"lastCommentAt" = now(),
"lastCommentAt" = GREATEST("Item"."lastCommentAt", comment.created_at),
"weightedComments" = "Item"."weightedComments" +
CASE WHEN comment."userId" = "Item"."userId" THEN 0 ELSE comment.trust END
FROM comment