diff --git a/packages/Sarga/API/Http/Controllers/SellerProduct.php b/packages/Sarga/API/Http/Controllers/SellerProduct.php index 4718989..6d982a1 100644 --- a/packages/Sarga/API/Http/Controllers/SellerProduct.php +++ b/packages/Sarga/API/Http/Controllers/SellerProduct.php @@ -43,13 +43,14 @@ class SellerProduct extends SellerProductController /** * Create a new controller instance. * $categoryRepository - * @param \Webkul\Product\Repositories\ProductRepository $productAttributeValueRepository + * @param \Webkul\Product\Repositories\ProductRepository $productAttributeValueRepository * @return void */ public function __construct( ProductRepository $productRepository, - SellerRepository $sellerRepository, - ) { + 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]); + } } diff --git a/packages/Sarga/API/Http/routes.php b/packages/Sarga/API/Http/routes.php index 2477492..3b65571 100644 --- a/packages/Sarga/API/Http/routes.php +++ b/packages/Sarga/API/Http/routes.php @@ -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 () {