Fix CategoryItemAPI->saveMap to save items with parents.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-06-20 20:29:24 +03:00
parent 387858a2de
commit db70255f4f
+5 -5
View File
@@ -19,10 +19,10 @@ class CategoryItemAPI extends AbstractItemAPI
}
public function saveMap($categotiesItems, $company = null) {
foreach ($categotiesItems as $category) {
$uuid = $category['id'];
$name = $category['name'];
$url = $category['url'];
foreach ($categotiesItems as $category_json) {
$uuid = $category_json['id'];
$name = $category_json['name'];
$url = $category_json['url'];
$category = Category::firstOrCreate([
'uuid' => $uuid,
@@ -33,7 +33,7 @@ class CategoryItemAPI extends AbstractItemAPI
$item = new ItemAPI($this->fetcher);
$item->saveMap($category['items']);
$item->saveMap($category_json['items'], $category);
}
}
}