Skip to content

Node.js based forum software built for the modern web

fix lint

Barış Soner Uşaklıfb45b498a2fd
diff --git a/src/topics/popular.js b/src/topics/popular.js
index 5b5d3f9402..ee77ef7544 100644
--- a/src/topics/popular.js
+++ b/src/topics/popular.js
@@ -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([