From 39f08a97b3d1f37138de795f4fba548d5d1740df Mon Sep 17 00:00:00 2001 From: saimeunt Date: Sat, 14 Mar 2015 10:04:52 +0100 Subject: [PATCH] Refactor postAfterEditMethodCallbacks execution on server --- collections/posts.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/collections/posts.js b/collections/posts.js index b97c8677c..c8d01a1ed 100644 --- a/collections/posts.js +++ b/collections/posts.js @@ -492,10 +492,10 @@ Meteor.methods({ // ------------------------------ Callbacks ------------------------------ // - // run all post submit server callbacks on modifier object successively - modifier = postAfterEditMethodCallbacks.reduce(function(result, currentFunction) { - return currentFunction(result); - }, modifier); + // run all post after edit method callbacks successively + postAfterEditMethodCallbacks.forEach(function(currentFunction) { + currentFunction(modifier, postId); + }); // ------------------------------ After Update ------------------------------ // @@ -557,7 +557,7 @@ Meteor.methods({ Posts.update(postId, { $inc: { viewCount: 1 }}); } }, - + deletePostById: function(postId) { // remove post comments // if(!this.isSimulation) {