mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-28 23:29:37 +02:00
fix default categories nesting
This commit is contained in:
parent
55b32f9ce9
commit
21aabf7267
1 changed files with 4 additions and 6 deletions
|
@ -90,13 +90,11 @@ exports.getCategories = asyncWrapper(async (req, res, next) => {
|
||||||
} else {
|
} else {
|
||||||
query.order.push([orderType, 'ASC']);
|
query.order.push([orderType, 'ASC']);
|
||||||
}
|
}
|
||||||
|
|
||||||
categories = await Category.findAll(query);
|
categories = await Category.findAll(query);
|
||||||
categories.push(
|
defaultCategories
|
||||||
defaultCategories.filter(
|
.filter((category) => requestedTypes.indexOf(category.type) > -1)
|
||||||
(category) => requestedTypes.indexOf(category.type) > -1
|
.forEach((category) => categories.push(category));
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
success: true,
|
success: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue