From 8f916343f0e849d33069ac2a46b526ef87dfb2b1 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 12 Jan 2017 14:41:35 +0300 Subject: [PATCH] closes #5361 --- src/posts/delete.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/posts/delete.js b/src/posts/delete.js index a21f2bb81b..d54846c2fd 100644 --- a/src/posts/delete.js +++ b/src/posts/delete.js @@ -147,12 +147,15 @@ module.exports = function (Posts) { db.sortedSetsRemove(['posts:pid', 'posts:flagged'], pid, next); } ], function (err) { - if (err) { - return next(err); - } - plugins.fireHook('action:post.purge', {pid: pid, uid: uid}); - db.delete('post:' + pid, next); + next(err); }); + }, + function (next) { + Posts.getPostData(pid, next); + }, + function (postData, next) { + plugins.fireHook('action:post.purge', {post: postData, uid: uid}); + db.delete('post:' + pid, next); } ], callback); };