mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
fixed based on e2e finding a bug!
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const errors = require('../../errors');
|
||||
const UsersService = require('../../services/users');
|
||||
const {CREATE_ACTION, DELETE_ACTION} = require('../../perms/constants');
|
||||
const {
|
||||
IGNORE_FLAGS_AGAINST_STAFF,
|
||||
@@ -82,11 +83,17 @@ const createAction = async (ctx, {item_id, item_type, action_type, group_id, met
|
||||
metadata
|
||||
});
|
||||
|
||||
if (action_type === 'FLAG' && item_type === 'COMMENTS') {
|
||||
if (action_type === 'FLAG') {
|
||||
if (item_type === 'USERS') {
|
||||
|
||||
// The item is a comment, and this is a flag. Push that the comment was
|
||||
// flagged, don't wait for it to finish.
|
||||
pubsub.publish('commentFlagged', item);
|
||||
// Set the user's status as pending, as we need to review it.
|
||||
await UsersService.setStatus(item_id, 'PENDING');
|
||||
} else if (item_type === 'COMMENTS') {
|
||||
|
||||
// The item is a comment, and this is a flag. Push that the comment was
|
||||
// flagged, don't wait for it to finish.
|
||||
pubsub.publish('commentFlagged', item);
|
||||
}
|
||||
}
|
||||
|
||||
return action;
|
||||
|
||||
Reference in New Issue
Block a user