Skip to content

Commit

Permalink
fix if check update
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Oct 2, 2024
1 parent f08318f commit 4011d81
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions server/src/core/server/stacks/approveComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@ const approveComment = async (
}

// create notification if dsa enabled upon approval of previously rejected comment
if (tenant.dsa?.enabled && previousComment?.status === GQLCOMMENT_STATUS.REJECTED) {
await notifications.create(tenant.id, tenant.locale, {
targetUserID: result.after.authorID!,
comment: result.after,
previousStatus: result.before.status,
type: GQLNOTIFICATION_TYPE.PREVIOUSLY_REJECTED_COMMENT_APPROVED,
});
}
if (
tenant.dsa?.enabled &&
previousComment?.status === GQLCOMMENT_STATUS.REJECTED
) {
await notifications.create(tenant.id, tenant.locale, {
targetUserID: result.after.authorID!,
comment: result.after,
previousStatus: result.before.status,
type: GQLNOTIFICATION_TYPE.PREVIOUSLY_REJECTED_COMMENT_APPROVED,
});
}

// if comment was previously rejected, system withheld, or in pre-mod,
Expand Down

0 comments on commit 4011d81

Please sign in to comment.