From 6d701ef49e7fa32af1699e1e81bee6b6f7591a5d Mon Sep 17 00:00:00 2001 From: David Jay Date: Thu, 8 Dec 2016 13:25:18 -0500 Subject: [PATCH] Updating to detect new status format. --- client/coral-plugin-commentbox/CommentBox.js | 2 +- routes/api/comments/index.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index df158b3e1..0167d517f 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -46,7 +46,7 @@ class CommentBox extends Component { .then((postedComment) => { const commentId = postedComment.id; const status = postedComment.status; - if (status === 'rejected') { + if (status[0] && status[0].type === 'rejected') { addNotification('error', lang.t('comment-post-banned-word')); } else if (premod === 'pre') { addNotification('success', lang.t('comment-post-notif-premod')); diff --git a/routes/api/comments/index.js b/routes/api/comments/index.js index b82c1faf3..32b2cb4cc 100644 --- a/routes/api/comments/index.js +++ b/routes/api/comments/index.js @@ -95,7 +95,6 @@ router.post('/', wordlist.filter('body'), (req, res, next) => { author_id: req.user.id })) .then((comment) => { - // The comment was created! Send back the created comment. res.status(201).send(comment); })