mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
topics.getPids will return mainPid as well
This commit is contained in:
@@ -36,24 +36,15 @@ module.exports = function(Categories) {
|
||||
}
|
||||
|
||||
updatePostCount(tid, oldCid, cid);
|
||||
async.parallel({
|
||||
mainPid: function(next) {
|
||||
topics.getTopicField(tid, 'mainPid', next);
|
||||
},
|
||||
pids: function(next) {
|
||||
topics.getPids(tid, next);
|
||||
}
|
||||
}, function(err, results) {
|
||||
topics.getPids(tid, function(err, pids) {
|
||||
if (err) {
|
||||
return winston.error(err.message);
|
||||
}
|
||||
|
||||
if (!results.mainPid && results.pids && !results.pids.length) {
|
||||
if (pids && !pids.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var pids = [results.mainPid].concat(results.pids);
|
||||
|
||||
var keys = pids.map(function(pid) {
|
||||
return 'post:' + pid;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user