Barış Soner Uşaklı 10 years ago
parent aa1f56b316
commit ed57a41d17

@ -153,16 +153,20 @@ adminController.categories.getAll = function(req, res, next) {
var active = [], var active = [],
disabled = []; disabled = [];
categories.getAllCategories(req.uid, function (err, categoryData) { async.waterfall([
if (err) { function(next) {
return next(err); db.getSortedSetRange('categories:cid', 0, -1, next);
},
function(cids, next) {
categories.getCategoriesData(cids, next);
},
function(categories, next) {
plugins.fireHook('filter:admin.categories.get', {req: req, res: res, categories: categories}, next);
} }
], function(err, data) {
plugins.fireHook('filter:admin.categories.get', {req: req, res: res, categories: categoryData}, function(err, data) {
if (err) { if (err) {
return next(err); return next(err);
} }
data.categories.filter(Boolean).forEach(function(category) { data.categories.filter(Boolean).forEach(function(category) {
(category.disabled ? disabled : active).push(category); (category.disabled ? disabled : active).push(category);
}); });
@ -172,7 +176,6 @@ adminController.categories.getAll = function(req, res, next) {
disabled: disabled disabled: disabled
}); });
}); });
});
}; };
adminController.tags.get = function(req, res, next) { adminController.tags.get = function(req, res, next) {

Loading…
Cancel
Save