Implement approve and live updates

This commit is contained in:
Chi Vinh Le
2017-08-02 21:34:48 +07:00
parent b6b7570bcc
commit da0d0349dd
8 changed files with 142 additions and 16 deletions
-10
View File
@@ -350,16 +350,6 @@ 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 (status === 'ACCEPTED') {
// Publish the comment status change via the subscription.
pubsub.publish('commentAccepted', comment);
} else if (status === 'REJECTED') {
// Publish the comment status change via the subscription.
pubsub.publish('commentRejected', comment);
}
return comment;
};