optimized home

This commit is contained in:
barisusakli
2014-08-14 09:59:40 -04:00
parent c58712e2a9
commit 5c91bc4335
2 changed files with 40 additions and 27 deletions

View File

@@ -69,17 +69,7 @@ Controllers.home = function(req, res, next) {
return next(err);
}
function getRecentReplies(category, callback) {
categories.getRecentTopicReplies(category.cid, uid, parseInt(category.numRecentReplies, 10), function (err, posts) {
if (err) {
return callback(err);
}
category.posts = posts;
callback();
});
}
async.each(categoryData, getRecentReplies, function (err) {
categories.getRecentTopicReplies(categoryData, function(err) {
next(err, categoryData);
});
});