fix: error when category doesnt have image
This commit is contained in:
@@ -53,7 +53,7 @@ class CategoriesHandler
|
|||||||
'data' => array_map(static function ($category) {
|
'data' => array_map(static function ($category) {
|
||||||
return [
|
return [
|
||||||
'id' => (int)$category['id'],
|
'id' => (int)$category['id'],
|
||||||
'image' => $category['image'],
|
'image' => $category['image'] ?? '',
|
||||||
'name' => $category['name'],
|
'name' => $category['name'],
|
||||||
'description' => $category['description'],
|
'description' => $category['description'],
|
||||||
'children' => $category['children'],
|
'children' => $category['children'],
|
||||||
@@ -72,7 +72,7 @@ class CategoriesHandler
|
|||||||
$category['children'] = $children;
|
$category['children'] = $children;
|
||||||
}
|
}
|
||||||
|
|
||||||
$image = $this->ocImageTool->resize($category['image'], self::THUMB_SIZE, self::THUMB_SIZE, 'no_image.png');
|
$image = $this->ocImageTool->resize($category['image'] ?? '', self::THUMB_SIZE, self::THUMB_SIZE, 'no_image.png');
|
||||||
|
|
||||||
$branch[] = [
|
$branch[] = [
|
||||||
'id' => (int)$category['id'],
|
'id' => (int)$category['id'],
|
||||||
|
|||||||
Reference in New Issue
Block a user