From 3ed2a081e574f0cafae1cb490bb67ad00831efcd Mon Sep 17 00:00:00 2001 From: dwindown Date: Thu, 20 Nov 2025 22:33:21 +0700 Subject: [PATCH] refactor: Standardize edit routes to /{entity}/{id}/edit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consistency fix: All edit routes now follow same pattern Before: - Products: /products/123/edit ✅ - Orders: /orders/123/edit ✅ - Coupons: /coupons/123 ❌ (inconsistent) After: - Products: /products/123/edit ✅ - Orders: /orders/123/edit ✅ - Coupons: /coupons/123/edit ✅ (now consistent) Changes: 1. App.tsx - Route: /coupons/:id → /coupons/:id/edit 2. Coupons/index.tsx - Link: /coupons/${id} → /coupons/${id}/edit Benefits: ✅ Consistent URL pattern across all entities ✅ Clear intent (edit vs detail) ✅ Easier to add detail pages later if needed ✅ Follows REST conventions Note: Even though coupons/products have no detail page in admin, using /edit suffix maintains consistency and allows future expansion. --- admin-spa/src/App.tsx | 2 +- admin-spa/src/routes/Coupons/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-spa/src/App.tsx b/admin-spa/src/App.tsx index 76418d9..03cbe13 100644 --- a/admin-spa/src/App.tsx +++ b/admin-spa/src/App.tsx @@ -478,7 +478,7 @@ function AppRoutes() { {/* Coupons */} } /> } /> - } /> + } /> {/* Customers */} } /> diff --git a/admin-spa/src/routes/Coupons/index.tsx b/admin-spa/src/routes/Coupons/index.tsx index 59f4cdd..47dacde 100644 --- a/admin-spa/src/routes/Coupons/index.tsx +++ b/admin-spa/src/routes/Coupons/index.tsx @@ -253,7 +253,7 @@ export default function CouponsIndex() { /> - + {coupon.code} {coupon.description && (