mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
Delete errors
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = function(Categories) {
|
|||||||
description: ( data.description ? data.description : '' ),
|
description: ( data.description ? data.description : '' ),
|
||||||
icon: ( data.icon ? data.icon : '' ),
|
icon: ( data.icon ? data.icon : '' ),
|
||||||
bgColor: data.bgColor || colours[0],
|
bgColor: data.bgColor || colours[0],
|
||||||
color: ( data.color ? data.color : '' ),
|
color: data.color || colours[1],
|
||||||
slug: slug,
|
slug: slug,
|
||||||
parentCid: ( data.parentCid ? data.parentCid : 0 ),
|
parentCid: ( data.parentCid ? data.parentCid : 0 ),
|
||||||
topic_count: 0,
|
topic_count: 0,
|
||||||
|
|||||||
@@ -136,16 +136,16 @@ adminController.categories.get = function(req, res, next) {
|
|||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.fireHook('filter:admin.categories.get', {req: req, res: res, category: data.category[0], privileges: data.privileges}, function(err, data) {
|
plugins.fireHook('filter:admin.category.get', {req: req, res: res, category: data.category[0], privileges: data.privileges}, function(err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.render('admin/manage/category', {
|
res.render('admin/manage/category', {
|
||||||
category: data.category,
|
category: data.category,
|
||||||
privileges: data.privileges
|
privileges: data.privileges
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -158,19 +158,19 @@ adminController.categories.getAll = function(req, res, next) {
|
|||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.fireHook('filter:admin.categories.getAll', {req: req, res: res, categories: categoryData}, 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);
|
||||||
});
|
});
|
||||||
|
|
||||||
res.render('admin/manage/categories', {
|
res.render('admin/manage/categories', {
|
||||||
active: active,
|
active: active,
|
||||||
disabled: disabled
|
disabled: disabled
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user