mirror of
https://github.com/wassname/talk.git
synced 2026-10-02 12:50:49 +08:00
Add userFlagged subscription
This commit is contained in:
1 parent
7885b025ee
commit
6aece16fd0
6 files changed
+35
-4
No files matched your search
@@ -73,10 +73,20 @@ const createAction = async (
|
||||
metadata,
|
||||
});
|
||||
|
||||
if (action_type === 'FLAG' && 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);
|
||||
if (action_type === 'FLAG') {
|
||||
switch (item_type) {
|
||||
case '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);
|
||||
break;
|
||||
case 'USERS':
|
||||
// The item is a user, and this is a flag. Push that the user was
|
||||
// flagged, don't wait for it to finish.
|
||||
pubsub.publish('userFlagged', item);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
return action;
|
||||
|
||||
Reference in new issue
Block a user