diff --git a/server/src/core/server/models/action/moderation/comment.ts b/server/src/core/server/models/action/moderation/comment.ts index 54a4d8845d..97a51d326f 100644 --- a/server/src/core/server/models/action/moderation/comment.ts +++ b/server/src/core/server/models/action/moderation/comment.ts @@ -64,6 +64,12 @@ export interface CommentModerationAction extends TenantResource { * createdAt is the time that the moderation action was created on. */ createdAt: Date; + + /** + * reportID is the DSAReport on which an illegal content decision was made that led to + * this comment moderation action. + */ + reportID?: string; } export type CreateCommentModerationActionInput = Omit< diff --git a/server/src/core/server/services/dsaReports/reports.ts b/server/src/core/server/services/dsaReports/reports.ts index 064a2ebacc..caa303adba 100644 --- a/server/src/core/server/services/dsaReports/reports.ts +++ b/server/src/core/server/services/dsaReports/reports.ts @@ -232,6 +232,7 @@ export async function makeDSAReportDecision( legalGrounds, detailedExplanation, }, + reportID, req, false, // set to false because we're about to notify below isArchived diff --git a/server/src/core/server/stacks/rejectComment.ts b/server/src/core/server/stacks/rejectComment.ts index 2cadeadd3b..add6826469 100644 --- a/server/src/core/server/stacks/rejectComment.ts +++ b/server/src/core/server/stacks/rejectComment.ts @@ -85,6 +85,7 @@ const rejectComment = async ( legalGrounds?: string | undefined; detailedExplanation?: string | undefined; }, + reportID?: string, request?: Request | undefined, sendNotification = true, isArchived = false @@ -106,6 +107,7 @@ const rejectComment = async ( moderatorID, rejectionReason: reason, status: GQLCOMMENT_STATUS.REJECTED, + reportID, }, now, isArchived,