From 0c1c42d36223b4dcaf47387386afce976f77e777 Mon Sep 17 00:00:00 2001 From: yariplus Date: Sat, 12 Sep 2015 19:41:19 -0400 Subject: [PATCH] parallel not needed --- src/controllers/admin.js | 48 ++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/controllers/admin.js b/src/controllers/admin.js index f40ce3c84c..7d1e55d8c2 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -348,32 +348,28 @@ adminController.navigation.get = function(req, res, next) { }; adminController.homepage.get = function(req, res, next) { - async.parallel({ - categoryData: function(next) { - async.waterfall([ - function(next) { - db.getSortedSetRange('cid:0:children', 0, -1, next); - }, - function(cids, next) { - privileges.categories.filterCids('find', cids, 0, next); - }, - function(cids, next) { - categories.getMultipleCategoryFields(cids, ['name', 'slug'], next); - }, - function(categoryData, next) { - async.map(categoryData, function(category, next) { - var route = 'category/' + category.slug; - - next(null, { - route: route, - name: 'Category: ' + category.name - }); - }, next); - } - ], next); + async.waterfall([ + function(next) { + db.getSortedSetRange('cid:0:children', 0, -1, next); + }, + function(cids, next) { + privileges.categories.filterCids('find', cids, 0, next); + }, + function(cids, next) { + categories.getMultipleCategoryFields(cids, ['name', 'slug'], next); + }, + function(categoryData, next) { + async.map(categoryData, function(category, next) { + var route = 'category/' + category.slug; + + next(null, { + route: route, + name: 'Category: ' + category.name + }); + }, next); } - }, function(err, results) { - if (err || !results || !results.categoryData) results = {categoryData:[]}; + ], function(err, categoryData) { + if (err || !categoryData) categoryData = []; plugins.fireHook('filter:homepage.get', {routes: [ { @@ -388,7 +384,7 @@ adminController.homepage.get = function(req, res, next) { route: 'popular', name: 'Popular' } - ].concat(results.categoryData)}, function(err, data) { + ].concat(categoryData)}, function(err, data) { data.routes.push({ route: '', name: 'Custom'