Skip to content

Commit

Permalink
Merge pull request #4393 from coralproject/feat/CORL-2934-reason-mode…
Browse files Browse the repository at this point in the history
…rate-reject

[CORL-2934]: DSA - Send rejection reason through when illegal content decision made
  • Loading branch information
kabeaty authored Nov 14, 2023
2 parents b18e52c + 1a87a22 commit 0a73efc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 9 additions & 4 deletions server/src/core/server/services/dsaReports/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand All @@ -205,7 +205,12 @@ export async function makeDSAReportDecision(
commentID,
commentRevisionID,
userID,
now
now,
{
code: GQLREJECTION_REASON_CODE.ILLEGAL_CONTENT,
legalGrounds,
detailedExplanation,
}
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0a73efc

Please sign in to comment.