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

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

Loading…
Cancel
Save