generic getObject

This commit is contained in:
barisusakli
2015-09-21 12:59:41 -04:00
parent 1dd706d0b2
commit f3b6a5fbb9
5 changed files with 52 additions and 74 deletions

View File

@@ -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;