mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
ensure that events are handled sync
This commit is contained in:
+2
-2
@@ -75,7 +75,7 @@ module.exports = class ActionsService {
|
||||
});
|
||||
|
||||
// Emit that there was a new action created.
|
||||
events.emitAsync(ACTIONS_NEW, foundAction);
|
||||
await events.emitAsync(ACTIONS_NEW, foundAction);
|
||||
|
||||
return foundAction;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ module.exports = class ActionsService {
|
||||
}
|
||||
|
||||
// Emit that the action was deleted.
|
||||
events.emitAsync(ACTIONS_DELETE, action);
|
||||
await events.emitAsync(ACTIONS_DELETE, action);
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ module.exports = class CommentsService {
|
||||
const savedCommentModel = await commentModel.save();
|
||||
|
||||
// Emit that the comment was created!
|
||||
events.emitAsync(COMMENTS_NEW, savedCommentModel);
|
||||
await events.emitAsync(COMMENTS_NEW, savedCommentModel);
|
||||
|
||||
return savedCommentModel;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ module.exports = class CommentsService {
|
||||
created_at: new Date(),
|
||||
});
|
||||
|
||||
events.emitAsync(COMMENTS_EDIT, originalComment, editedComment);
|
||||
await events.emitAsync(COMMENTS_EDIT, originalComment, editedComment);
|
||||
|
||||
return editedComment;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ module.exports = class CommentsService {
|
||||
|
||||
// Emit that the comment was edited, and pass the original comment and the
|
||||
// edited comment.
|
||||
events.emitAsync(COMMENTS_EDIT, originalComment, editedComment);
|
||||
await events.emitAsync(COMMENTS_EDIT, originalComment, editedComment);
|
||||
|
||||
return editedComment;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user