Simplify subscription

This commit is contained in:
Chi Vinh Le
2017-06-16 19:19:59 +07:00
parent ecf63ffb55
commit 5f450adbaf
10 changed files with 59 additions and 34 deletions
+6
View File
@@ -346,6 +346,12 @@ const setStatus = async ({user, loaders: {Comments}, pubsub}, {id, status}) => {
// adjust the affected user's karma in the next tick.
process.nextTick(adjustKarma(Comments, id, status));
if (pubsub) {
// Publish the comment status change via the subscription.
pubsub.publish('commentStatusChanged', comment);
}
return comment;
};