diff --git a/packages/Sarga/API/Http/Resources/Catalog/Category.php b/packages/Sarga/API/Http/Resources/Catalog/Category.php index 56c7be4af..6d3a17120 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Category.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Category.php @@ -4,7 +4,7 @@ namespace Sarga\API\Http\Resources\Catalog; use Illuminate\Support\Facades\Storage; use Illuminate\Http\Resources\Json\JsonResource; -use Sarga\API\Http\Resources\Core\Vendor as VendorResource; + class Category extends JsonResource { /** @@ -22,7 +22,7 @@ class Category extends JsonResource 'slug' => $this->slug, 'display_mode' => $this->display_mode, 'image_url' => $this->image_url, - 'vendors' => VendorResource::collection($this->vendors), + 'vendors' => CategoryVendor::collection($this->vendors), 'category_icon_path' => $this->category_icon_path ? Storage::url($this->category_icon_path) : null, diff --git a/packages/Sarga/API/Http/Resources/Catalog/CategoryVendor.php b/packages/Sarga/API/Http/Resources/Catalog/CategoryVendor.php new file mode 100644 index 000000000..f3524f0cb --- /dev/null +++ b/packages/Sarga/API/Http/Resources/Catalog/CategoryVendor.php @@ -0,0 +1,22 @@ + $this->id, + 'shop_title' => $this->shop_title, + ]; + } +} \ No newline at end of file diff --git a/packages/Sarga/API/Http/Resources/Catalog/VendorCategory.php b/packages/Sarga/API/Http/Resources/Catalog/VendorCategory.php deleted file mode 100644 index bf4c0c257..000000000 --- a/packages/Sarga/API/Http/Resources/Catalog/VendorCategory.php +++ /dev/null @@ -1,26 +0,0 @@ - $this->id, - 'name' => $this->name, - 'display_mode' => $this->display_mode, - 'image_url' => $this->image_url, - 'children' => Category::collection($this->children), - ]; - } -} \ No newline at end of file