From 1a87a22688d8c8655e4d1ee4a656e730ae2ffa2d Mon Sep 17 00:00:00 2001 From: Kathryn Beaty Date: Tue, 14 Nov 2023 08:40:14 -0500 Subject: [PATCH] send through rejection reason when decision made on illegal content report --- .../src/core/server/services/dsaReports/reports.ts | 13 +++++++++---- .../services/notifications/internal/context.ts | 3 --- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/src/core/server/services/dsaReports/reports.ts b/server/src/core/server/services/dsaReports/reports.ts index ddb711e6ad..86eccf7f65 100644 --- a/server/src/core/server/services/dsaReports/reports.ts +++ b/server/src/core/server/services/dsaReports/reports.ts @@ -16,6 +16,7 @@ import { rejectComment } from "coral-server/stacks"; import { GQLDSAReportDecisionLegality, GQLDSAReportStatus, + GQLREJECTION_REASON_CODE, } from "coral-server/graph/schema/__generated__/types"; import { I18n } from "../i18n"; @@ -182,13 +183,12 @@ export async function makeDSAReportDecision( input: MakeDSAReportDecisionInput, now = new Date() ) { - // TODO: Send through rejection legalGrounds and detailedExplanation once backend support is available const { commentID, commentRevisionID, userID, - // legalGrounds, - // detailedExplanation, + legalGrounds, + detailedExplanation, } = input; // REJECT if ILLEGAL @@ -205,7 +205,12 @@ export async function makeDSAReportDecision( commentID, commentRevisionID, userID, - now + now, + { + code: GQLREJECTION_REASON_CODE.ILLEGAL_CONTENT, + legalGrounds, + detailedExplanation, + } ); } diff --git a/server/src/core/server/services/notifications/internal/context.ts b/server/src/core/server/services/notifications/internal/context.ts index 94dd66ec04..291a3f5b4a 100644 --- a/server/src/core/server/services/notifications/internal/context.ts +++ b/server/src/core/server/services/notifications/internal/context.ts @@ -151,9 +151,6 @@ export class InternalNotificationContext { const result = translate(bundle, text, key, args); - // eslint-disable-next-line no-console - console.log(result, args); - return result; }