mirror of
https://github.com/wassname/talk.git
synced 2026-10-04 13:10:23 +08:00
ensure that events are handled sync
This commit is contained in:
1 parent
ec2c62a607
commit
d43d359048
2 files changed
+5
-5
No files matched your search
+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