From 5e9f8eb62497e35edbe7078faa53d922069dc9b7 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 24 Jan 2017 12:42:49 -0700 Subject: [PATCH] Fixed statuses --- graph/mutators/comment.js | 10 +++++----- models/comment.js | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index 2e7a14877..6bd7cea26 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -57,7 +57,7 @@ const resolveNewCommentStatus = (context, {asset_id, body}, wordlist = {}) => { let status; if (wordlist.banned) { - status = Promise.resolve('rejected'); + status = Promise.resolve('REJECTED'); } else { status = AssetsService .rectifySettings(AssetsService.findById(asset_id).then((asset) => { @@ -81,9 +81,9 @@ const resolveNewCommentStatus = (context, {asset_id, body}, wordlist = {}) => { // Reject if the comment is too long if (charCountEnable && body.length > charCount) { - return 'rejected'; + return 'REJECTED'; } - return moderation === 'pre' ? 'premod' : null; + return moderation === 'PRE' ? 'PREMOD' : null; }); } @@ -125,8 +125,8 @@ const createPublicComment = (context, commentInput) => { // defined in a checkable schema. return context.mutators.Action.createAction(null, { item_id: comment.id, - item_type: 'comments', - action_type: 'flag', + item_type: 'COMMENTS', + action_type: 'FLAG', metadata: { field: 'body', details: 'Matched suspect word filters.' diff --git a/models/comment.js b/models/comment.js index 5ceef0e29..b656f9238 100644 --- a/models/comment.js +++ b/models/comment.js @@ -6,6 +6,7 @@ const STATUSES = [ 'ACCEPTED', 'REJECTED', 'PREMOD', + null ]; /**