Add some comments

This commit is contained in:
Chi Vinh Le
2017-06-12 23:50:09 +07:00
parent 70177d3a2c
commit ce76335fda
2 changed files with 13 additions and 0 deletions
@@ -130,6 +130,8 @@ function getReactionConfig(reaction) {
const response = Comments.get.load(item_id).then((comment) => {
return Action.create({item_id, item_type: 'COMMENTS', action_type: REACTION})
.then((action) => {
// The comment is needed to allow better filtering e.g. by asset_id.
pubsub.publish(`${reaction}ActionCreated`, {action, comment});
return Promise.resolve(action);
});
@@ -140,6 +142,8 @@ function getReactionConfig(reaction) {
const response = Action.delete({id})
.then((action) => {
return Comments.get.load(action.item_id).then((comment) => {
// The comment is needed to allow better filtering e.g. by asset_id.
pubsub.publish(`${reaction}ActionDeleted`, {action, comment});
return Promise.resolve(action);
});