Add seller product deletion

This commit is contained in:
Shohrat 2023-09-15 00:14:45 +05:00
parent 84dd5dd1b8
commit fecfddc180
2 changed files with 12 additions and 3 deletions

View File

@ -49,7 +49,8 @@ class SellerProduct extends SellerProductController
public function __construct(
ProductRepository $productRepository,
SellerRepository $sellerRepository,
) {
)
{
$this->_config = request('_config');
$this->productRepository = $productRepository;
$this->sellerRepository = $sellerRepository;
@ -97,6 +98,7 @@ class SellerProduct extends SellerProductController
]);
}
}
public function sellerOrderDetail(Request $request)
{
$validation = Validator::make($request->all(), [
@ -332,4 +334,10 @@ class SellerProduct extends SellerProductController
]);
}
}
public function deleteProduct($product_id)
{
$this->productRepository->delete($product_id);
return response()->json(['success' => true]);
}
}

View File

@ -44,6 +44,7 @@ Route::group(['prefix' => 'api'], function () {
Route::get('products/{vendor_id}/{product_id}',[Vendors::class,'sellerProductsById']);
Route::post('create/product', [SellerProduct::class, 'storeSellerProd']);
Route::post('update/product', [SellerProduct::class, 'updateProductFlat']);
Route::post('delete/product/{product_id}', [SellerProduct::class, 'deleteProduct']);
});
Route::group(['middleware' => ['locale', 'currency']], function () {