mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-28 15:19:36 +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 {
|
||||
query.order.push([orderType, 'ASC']);
|
||||
}
|
||||
|
||||
|
||||
categories = await Category.findAll(query);
|
||||
categories.push(
|
||||
defaultCategories.filter(
|
||||
(category) => requestedTypes.indexOf(category.type) > -1
|
||||
)
|
||||
);
|
||||
defaultCategories
|
||||
.filter((category) => requestedTypes.indexOf(category.type) > -1)
|
||||
.forEach((category) => categories.push(category));
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue