This commit is contained in:
Barış Soner Uşaklı
2017-05-26 18:11:37 -04:00
parent c133efa258
commit fb45b498a2

View File

@@ -9,13 +9,15 @@ module.exports = function (Topics) {
count = parseInt(count, 10) || 20;
if (term === 'alltime') {
return getAllTimePopular(uid, count, function (err, topics) {
if (err) {
return callback(err);
async.waterfall([
function (next) {
getAllTimePopular(uid, count, next);
},
function (topics, next) {
sortTiedTopicsByViews(topics, next);
}
sortTiedTopicsByViews(topics, callback);
});
], callback);
return;
}
async.waterfall([