mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
fix: returned data
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user