getLatestUndeletedPid will return string #1884

v1.18.x
barisusakli 11 years ago
parent 73e9a7fec0
commit bc2f7339ee

@ -53,11 +53,19 @@ module.exports = function(Categories) {
results.tids = results.tids.concat(results.pinnedTids);
async.map(results.tids, topics.getLatestUndeletedPid, function(err, topicPids) {
if (err) {
return callback(err);
}
pids = pids.concat(topicPids).filter(function(pid, index, array) {
return !!pid && array.indexOf(pid) === index;
});
posts.getPostSummaryByPids(pids, {stripTags: true}, function(err, posts) {
if (err) {
return callback(err);
}
posts = posts.sort(function(a, b) {
return parseInt(b.timestamp, 10) - parseInt(a.timestamp, 10);
}).slice(0, count);

@ -157,7 +157,7 @@ module.exports = function(Topics) {
next(parseInt(deleted, 10) === 0);
});
}, function(pid) {
callback(null, pid ? pid : null);
callback(null, pid ? pid.toString() : null);
});
});
};

Loading…
Cancel
Save