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

@ -135,12 +135,12 @@ adminController.categories.get = function(req, res, next) {
if (err) {
return next(err);
}
plugins.fireHook('filter:admin.category.get', {req: req, res: res, category: data.category[0], privileges: data.privileges}, function(err, data) {
if (err) {
return next(err);
}
res.render('admin/manage/category', {
category: data.category,
privileges: data.privileges
@ -153,24 +153,27 @@ adminController.categories.getAll = function(req, res, next) {
var active = [],
disabled = [];
categories.getAllCategories(req.uid, function (err, categoryData) {
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);
}
], function(err, data) {
if (err) {
return next(err);
}
plugins.fireHook('filter:admin.categories.get', {req: req, res: res, categories: categoryData}, function(err, data) {
if (err) {
return next(err);
}
data.categories.filter(Boolean).forEach(function(category) {
(category.disabled ? disabled : active).push(category);
});
res.render('admin/manage/categories', {
active: active,
disabled: disabled
});
data.categories.filter(Boolean).forEach(function(category) {
(category.disabled ? disabled : active).push(category);
});
res.render('admin/manage/categories', {
active: active,
disabled: disabled
});
});
};

Loading…
Cancel
Save