Skip to content

Commit

Permalink
feat: change /product to /
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrinasalm committed Nov 19, 2024
1 parent 6a75e11 commit 02096e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions resources/js/Pages/Product/Show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type FormData = {
export default function Show({ product }: { product: ProductType }) {
const handleDelete = () => {
if (confirm("Are you sure you want to delete this product?")) {
Inertia.delete(`/product/${product.id}/delete`, {
Inertia.delete(`/${product.id}/delete`, {
onSuccess: () => toast.success("Product has been deleted."),
onError: () => toast.error("Error deleting product."),
});
Expand Down Expand Up @@ -52,7 +52,7 @@ export default function Show({ product }: { product: ProductType }) {
<Head title="Detail Product" />
<div className="px-10 md:px-10 py-8">
<div>
<ButtonLink href="/product" leftIcon={ArrowLeft}>
<ButtonLink href="/" leftIcon={ArrowLeft}>
Back
</ButtonLink>
</div>
Expand Down
4 changes: 2 additions & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');

Route::prefix('/product')->group(function () {
Route::prefix('/')->group(function () {
Route::get('/', [ProductController::class, 'index'])->name('product.index');
Route::get('/create', [ProductController::class, 'create'])->name('product.create');
Route::post('/store', [ProductController::class, 'store'])->name('product.store');
Route::get('/{product}', [ProductController::class, 'show'])->name('product.show');
Route::get('/{product}/detail', [ProductController::class, 'show'])->name('product.show');
Route::get('/{product}/edit', [ProductController::class, 'edit'])->name('product.edit');
Route::post('/{product}/update', [ProductController::class, 'update'])->name('product.update');
Route::delete('/{product}/delete', [ProductController::class, 'destroy'])->name('product.destroy');
Expand Down

0 comments on commit 02096e0

Please sign in to comment.