mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
closes #1709
This commit is contained in:
@@ -55,13 +55,23 @@ module.exports = function(Posts) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
topics.getTopicFields(postData.tid, ['deleted'], function(err, topicData) {
|
||||
topics.getTopicFields(postData.tid, ['cid', 'deleted'], function(err, topicData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (parseInt(postData.deleted, 10) === 0 && parseInt(topicData.deleted, 10) !== 1) {
|
||||
db.decrObjectField('global', 'postCount', callback);
|
||||
async.parallel([
|
||||
function (next) {
|
||||
db.decrObjectField('global', 'postCount', next);
|
||||
},
|
||||
function (next) {
|
||||
db.decrObjectField('category:' + topicData.cid, 'post_count', next);
|
||||
},
|
||||
function (next) {
|
||||
db.decrObjectField('topic:' + postData.tid, 'postcount', next);
|
||||
}
|
||||
], callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user