Add product deletion

This commit is contained in:
Amanmyrat 2023-09-15 00:31:59 +05:00
parent 385fab9955
commit 3a1b75d9d7
2 changed files with 7 additions and 0 deletions

View File

@ -326,4 +326,10 @@ class SellerProduct extends SellerProductController
]);
}
}
public function deleteProduct($product_id)
{
$this->productRepository->delete($product_id);
return response()->json(['success' => true]);
}
}

View File

@ -38,6 +38,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 () {