removed unnecessary waterfall

v1.18.x
barisusakli 9 years ago
parent 89596b81e0
commit 86b616ab9e

@ -17,26 +17,22 @@ flagsController.get = function(req, res, next) {
var start = (page - 1) * itemsPerPage; var start = (page - 1) * itemsPerPage;
var stop = start + itemsPerPage - 1; var stop = start + itemsPerPage - 1;
async.waterfall([ async.parallel({
function (next) { flagData: function(next) {
async.parallel({ if (byUsername) {
flagData: function(next) { posts.getUserFlags(byUsername, sortBy, req.uid, start, stop, next);
if (byUsername) { } else {
posts.getUserFlags(byUsername, sortBy, req.uid, start, stop, next); var set = sortBy === 'count' ? 'posts:flags:count' : 'posts:flagged';
} else { posts.getFlags(set, req.uid, start, stop, next);
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);
analytics: function(next) { },
analytics.getDailyStatsForSet('analytics:flags', Date.now(), 30, next); assignees: function(next) {
}, user.getAdminsandGlobalMods(next);
assignees: function(next) {
user.getAdminsandGlobalMods(next);
}
}, next);
} }
], function (err, results) { }, function (err, results) {
if (err) { if (err) {
return next(err); return next(err);
} }

Loading…
Cancel
Save