topics.getPids will return mainPid as well

This commit is contained in:
barisusakli
2014-07-19 08:59:59 -04:00
parent 523b3db3f1
commit a69973e7a7
3 changed files with 20 additions and 21 deletions

View File

@@ -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;
});