Skip to content

Node.js based forum software built for the modern web

closes #5359

barisusakli1e137636c932
diff --git a/src/topics/delete.js b/src/topics/delete.js
index 91c1bf53e3..d7148f55c3 100644
--- a/src/topics/delete.js
+++ b/src/topics/delete.js
@@ -137,15 +137,18 @@ module.exports = function (Topics) {
function (next) {
reduceCounters(tid, next);
}
- ], next);
- }
- ], function (err) {
- if (err) {
- return callback(err);
+ ], function (err) {
+ next(err);
+ });
+ },
+ function (next) {
+ Topics.getTopicData(tid, next);
+ },
+ function (topicData, next) {
+ plugins.fireHook('action:topic.purge', {topic: topicData, uid: uid});
+ db.delete('topic:' + tid, next);
}
- plugins.fireHook('action:topic.purge', tid);
- db.delete('topic:' + tid, callback);
- });
+ ], callback);
};
function deleteFromFollowersIgnorers(tid, callback) {