Skip to content

Commit

Permalink
remove comment
Browse files Browse the repository at this point in the history
also flag comment before rejecting for banned word
  • Loading branch information
marcushaddon committed Nov 7, 2023
1 parent 9504b97 commit 6e9bb23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export interface ExternalModerationRequest {
tenantDomain: string;
}

// BOOKMARK: (marcushaddon) do we need a new type to maintain type safety with joi?
export type ExternalModerationResponse = Partial<
Pick<PhaseResult, "status" | "tags">
> & { actions: PhaseResult["commentActions"] };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export const wordListPhase: IntermediateModerationPhase = async ({
if (banned.isMatched) {
return {
status: GQLCOMMENT_STATUS.REJECTED,
commentActions: [
{
actionType: ACTION_TYPE.FLAG,
reason: GQLCOMMENT_FLAG_REASON.COMMENT_DETECTED_BANNED_WORD,
},
],
moderationAction: {
status: GQLCOMMENT_STATUS.REJECTED,
moderatorID: null,
Expand Down

0 comments on commit 6e9bb23

Please sign in to comment.