mirror of
https://github.com/wassname/talk.git
synced 2026-08-20 12:50:41 +08:00
Simplify subscription
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user