mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
refactor: returned fields
This commit is contained in:
@@ -11,7 +11,7 @@ categoriesController.get = async function (req, res, next) {
|
||||
const [categoryData, parent, allCategories] = await Promise.all([
|
||||
categories.getCategories([req.params.category_id], req.uid),
|
||||
categories.getParents([req.params.category_id]),
|
||||
categories.buildForSelectAll(req.uid),
|
||||
categories.buildForSelectAll(['text', 'value']),
|
||||
]);
|
||||
|
||||
const category = categoryData[0];
|
||||
@@ -22,7 +22,7 @@ categoriesController.get = async function (req, res, next) {
|
||||
category.parent = parent[0];
|
||||
allCategories.forEach(function (category) {
|
||||
if (category) {
|
||||
category.selected = parseInt(category.cid, 10) === parseInt(req.params.category_id, 10);
|
||||
category.selected = parseInt(category.value, 10) === parseInt(req.params.category_id, 10);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user