feat(category): implement category configuration management with sorting and validation
This commit is contained in:
@@ -207,12 +207,14 @@ class TenantResource extends JsonResource
|
||||
'nombre' => $category->nombre,
|
||||
'subcategories' => $childrenByParent
|
||||
->get($category->id, collect())
|
||||
->filter(fn (Category $child) => $child->is_enabled)
|
||||
->map($formatCategory)
|
||||
->values(),
|
||||
];
|
||||
};
|
||||
|
||||
return $categories
|
||||
->filter(fn (Category $category) => $category->is_enabled)
|
||||
->filter(fn (Category $category) => $category->categoria_id === null
|
||||
|| ! $categoryIds->has($category->categoria_id))
|
||||
->map($formatCategory)
|
||||
|
||||
Reference in New Issue
Block a user