mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 14:45:40 +08:00
Moved action creation upstream
This commit is contained in:
@@ -16,7 +16,7 @@ const createAction = ({user = {}}, {item_id, item_type, action_type, group_id, m
|
||||
return ActionsService.insertUserAction({
|
||||
item_id,
|
||||
item_type,
|
||||
user_id: group_id === 'Matched suspect word filter' ? null : user.id,
|
||||
user_id: user.id,
|
||||
group_id,
|
||||
action_type,
|
||||
metadata
|
||||
|
||||
@@ -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: {}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user