fix: show my product by id

This commit is contained in:
saparatayev 2022-03-09 16:28:55 +05:00
parent 9bae98d465
commit b7fb9573fb
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
<?php namespace AhmadFatoni\ApiGenerator\Controllers\API;
use Cms\Classes\Controller;
use Illuminate\Http\Request;
use AhmadFatoni\ApiGenerator\Helpers\Helpers;
use Illuminate\Support\Facades\Validator;
@ -9,7 +10,7 @@ use TPS\Birzha\Models\Term;
use TPS\Birzha\Models\Measure;
use TPS\Birzha\Models\Settings;
use October\Rain\Support\Facades\Event;
class ProductsAPIController extends KabinetAPIController
class ProductsAPIController extends Controller
{
protected $Product;
@ -477,7 +478,7 @@ class ProductsAPIController extends KabinetAPIController
}
public function showMyProductById($id) {
$data = $this->user->products()->with([
$data = \JWTAuth::parseToken()->authenticate()->products()->with([
'translations:locale,model_id,attribute_data',
'images:attachment_id,attachment_type,disk_name,file_name',
'measure.translations:locale,model_id,attribute_data',