Merge pull request #360 from coralproject/bugfix-suspect-reporting

Comments with suspect words should not show up as "Reported" by the user who posted them.
This commit is contained in:
Kim Gardner
2017-03-01 16:10:18 -05:00
committed by GitHub
+3 -1
View File
@@ -1,6 +1,7 @@
const errors = require('../../errors');
const AssetsService = require('../../services/assets');
const ActionsService = require('../../services/actions');
const CommentsService = require('../../services/comments');
const Wordlist = require('../../services/wordlist');
@@ -146,10 +147,11 @@ const createPublicComment = (context, commentInput) => {
// TODO: this is kind of fragile, we should refactor this to resolve
// all these const's that we're using like 'COMMENTS', 'FLAG' to be
// defined in a checkable schema.
return context.mutators.Action.create({
return ActionsService.insertUserAction({
item_id: comment.id,
item_type: 'COMMENTS',
action_type: 'FLAG',
user_id: null,
group_id: 'Matched suspect word filter',
metadata: {}
})