ensure that events are handled sync

This commit is contained in:
Wyatt Johnson
2017-08-21 08:49:56 -06:00
parent ec2c62a607
commit d43d359048
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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;
}
+3 -3
View File
@@ -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;
}