This commit is contained in:
sebseb7
2025-11-17 08:43:57 +01:00
parent 521cc307a3
commit 11ba2db893
5 changed files with 173 additions and 30 deletions

View File

@@ -7,11 +7,17 @@ const collectAllCategories = (categoryNode, categories = []) => {
// Add current category (skip root category 209)
if (categoryNode.id !== 209) {
// Extract subcategory IDs from children
const subcategoryIds = categoryNode.children
? categoryNode.children.map(child => child.id)
: [];
categories.push({
id: categoryNode.id,
name: categoryNode.name,
seoName: categoryNode.seoName,
parentId: categoryNode.parentId
parentId: categoryNode.parentId,
subcategories: subcategoryIds
});
}