fix: returned data

This commit is contained in:
Barış Soner Uşaklı
2019-09-20 19:04:47 -04:00
parent 84c19754e7
commit 87f6ac59b1
3 changed files with 14 additions and 14 deletions

View File

@@ -350,7 +350,13 @@ Categories.buildForSelectCategories = function (categories) {
categories = categories.filter(category => category && !category.parentCid);
categories.forEach(category => recursive(category, categoriesData, '', 0));
return categoriesData;
const pickFields = [
'name', 'level', 'disabledClass', 'icon', 'value', 'text',
'cid', 'parentCid', 'color', 'bgColor', 'backgroundImage', 'imageClass',
'disabled', 'depth',
];
return categoriesData.map(category => _.pick(category, pickFields));
};
Categories.async = require('../promisify')(Categories);