mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
generic getObject
This commit is contained in:
@@ -266,21 +266,5 @@ categoriesController.get = function(req, res, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
categoriesController.getCategory = function(req, res, next) {
|
||||
async.parallel({
|
||||
canRead: async.apply(privileges.categories.can, 'read', req.params.cid, req.uid),
|
||||
categoryData: async.apply(categories.getCategoryData, req.params.cid)
|
||||
}, function(err, results) {
|
||||
if (err || !results.categoryData) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!results.canRead) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
res.json(results.categoryData);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = categoriesController;
|
||||
|
||||
Reference in New Issue
Block a user