mirror of
https://github.com/wassname/talk.git
synced 2026-08-14 12:50:17 +08:00
BE Subscription for Featured Comments
This commit is contained in:
@@ -5,7 +5,11 @@ const {ADD_COMMENT_TAG, REMOVE_COMMENT_TAG} = require('../../perms/constants');
|
||||
/**
|
||||
* Modifies the targeted model with the specified operation to add/remove a tag.
|
||||
*/
|
||||
const modify = async ({user, loaders: {Tags}}, operation, {name, id, item_type, asset_id}) => {
|
||||
const modify = async ({user, loaders: {Tags}, pubsub}, operation, {name, id, item_type, asset_id}) => {
|
||||
|
||||
if (operation.name === 'add') {
|
||||
pubsub.publish('commentFeatured', {});
|
||||
}
|
||||
|
||||
// Get the global list of tags from the dataloader.
|
||||
const tags = await Tags.getAll.load({id, item_type, asset_id});
|
||||
|
||||
Reference in New Issue
Block a user