v1.18.x
Barış Soner Uşaklı 6 years ago
parent e8f3c25676
commit 2996a5dc25

@ -15,7 +15,20 @@ categoriesController.get = function (req, res, callback) {
async.parallel({
category: async.apply(categories.getCategories, [req.params.category_id], req.uid),
parent: async.apply(categories.getParents, [req.params.category_id]),
allCategories: async.apply(categories.buildForSelect, req.uid, 'read'),
allCategories: function (next) {
async.waterfall([
function (next) {
categories.getAllCidsFromSet('categories:cid', next);
},
function (cids, next) {
categories.getCategories(cids, req.uid, next);
},
function (categoryData, next) {
categoryData = categories.getTree(categoryData);
categories.buildForSelectCategories(categoryData, next);
},
], next);
},
}, next);
},
function (data, next) {

Loading…
Cancel
Save