Add seller product deletion
This commit is contained in:
parent
84dd5dd1b8
commit
fecfddc180
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue