mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 04:16:37 -04:00
change callback syntax and add return statement
This commit is contained in:
parent
f2f8f4b2c3
commit
04061aca9e
2 changed files with 11 additions and 4 deletions
|
@ -123,7 +123,7 @@ Comments.before.update(function (userId, doc, fieldNames, modifier, options) {
|
|||
}
|
||||
});
|
||||
|
||||
commentAfterSubmitMethodCallbacks.push(function (comment) {
|
||||
function afterCommentOperations (comment) {
|
||||
|
||||
var userId = comment.userId,
|
||||
commentAuthor = Meteor.users.findOne(userId);
|
||||
|
@ -143,7 +143,11 @@ commentAfterSubmitMethodCallbacks.push(function (comment) {
|
|||
// upvote comment
|
||||
Telescope.upvoteItem(Comments, comment, commentAuthor);
|
||||
|
||||
});
|
||||
return comment;
|
||||
|
||||
};
|
||||
|
||||
commentAfterSubmitMethodCallbacks.push(afterCommentOperations);
|
||||
|
||||
// ------------------------------------------------------------------------------------------- //
|
||||
// -------------------------------------- Submit Comment ------------------------------------- //
|
||||
|
|
|
@ -26,7 +26,8 @@ Posts.hooks.approvedCallbacks.push(function (post) {
|
|||
});
|
||||
|
||||
// add new comment notification callback on comment submit
|
||||
commentAfterSubmitMethodCallbacks.push(function (comment) {
|
||||
function addCommentNotification (comment) {
|
||||
|
||||
if(Meteor.isServer && !comment.disableNotifications){
|
||||
|
||||
var post = Posts.findOne(comment.postId),
|
||||
|
@ -81,7 +82,9 @@ commentAfterSubmitMethodCallbacks.push(function (comment) {
|
|||
|
||||
return comment;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
commentAfterSubmitMethodCallbacks.push(addCommentNotification);
|
||||
|
||||
var emailNotifications = {
|
||||
propertyName: 'emailNotifications',
|
||||
|
|
Loading…
Add table
Reference in a new issue