From 86b616ab9efc9503be3b64cb0ce29d78b2d5dbdb Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 16 Sep 2016 00:46:06 +0300 Subject: [PATCH] removed unnecessary waterfall --- src/controllers/admin/flags.js | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/controllers/admin/flags.js b/src/controllers/admin/flags.js index 56852a6a65..4192372163 100644 --- a/src/controllers/admin/flags.js +++ b/src/controllers/admin/flags.js @@ -17,26 +17,22 @@ flagsController.get = function(req, res, next) { var start = (page - 1) * itemsPerPage; var stop = start + itemsPerPage - 1; - async.waterfall([ - function (next) { - async.parallel({ - flagData: function(next) { - if (byUsername) { - posts.getUserFlags(byUsername, sortBy, req.uid, start, stop, next); - } else { - var set = sortBy === 'count' ? 'posts:flags:count' : 'posts:flagged'; - posts.getFlags(set, req.uid, start, stop, next); - } - }, - analytics: function(next) { - analytics.getDailyStatsForSet('analytics:flags', Date.now(), 30, next); - }, - assignees: function(next) { - user.getAdminsandGlobalMods(next); - } - }, next); + async.parallel({ + flagData: function(next) { + if (byUsername) { + posts.getUserFlags(byUsername, sortBy, req.uid, start, stop, next); + } else { + var set = sortBy === 'count' ? 'posts:flags:count' : 'posts:flagged'; + posts.getFlags(set, req.uid, start, stop, next); + } + }, + analytics: function(next) { + analytics.getDailyStatsForSet('analytics:flags', Date.now(), 30, next); + }, + assignees: function(next) { + user.getAdminsandGlobalMods(next); } - ], function (err, results) { + }, function (err, results) { if (err) { return next(err); }