Skip to content

Commit

Permalink
add reportID to comment mod action
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Nov 30, 2023
1 parent a68a88e commit 235b972
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/src/core/server/models/action/moderation/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down
1 change: 1 addition & 0 deletions server/src/core/server/services/dsaReports/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export async function makeDSAReportDecision(
legalGrounds,
detailedExplanation,
},
reportID,
req,
false, // set to false because we're about to notify below
isArchived
Expand Down
2 changes: 2 additions & 0 deletions server/src/core/server/stacks/rejectComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const rejectComment = async (
legalGrounds?: string | undefined;
detailedExplanation?: string | undefined;
},
reportID?: string,
request?: Request | undefined,
sendNotification = true,
isArchived = false
Expand All @@ -106,6 +107,7 @@ const rejectComment = async (
moderatorID,
rejectionReason: reason,
status: GQLCOMMENT_STATUS.REJECTED,
reportID,
},
now,
isArchived,
Expand Down

0 comments on commit 235b972

Please sign in to comment.