diff --git a/api/paidAction/itemCreate.js b/api/paidAction/itemCreate.js index 9f6a23fb..6c41ee24 100644 --- a/api/paidAction/itemCreate.js +++ b/api/paidAction/itemCreate.js @@ -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