return post count to with categories

This commit is contained in:
barisusakli
2014-05-19 19:24:06 -04:00
parent 4acc264cb8
commit cd08a16f77
2 changed files with 22 additions and 13 deletions

View File

@@ -71,9 +71,11 @@ Controllers.home = function(req, res, next) {
function getRecentReplies(category, callback) {
categories.getRecentReplies(category.cid, uid, parseInt(category.numRecentReplies, 10), function (err, posts) {
if (err) {
return callback(err);
}
category.posts = posts;
category.post_count = posts.length > 2 ? 2 : posts.length; // this was a hack to make metro work back in the day, post_count should just = length
callback(null);
callback();
});
}