From a2285baeb44a313d80febdafc6f7495df3b880b0 Mon Sep 17 00:00:00 2001 From: Nora Date: Thu, 25 Jun 2026 17:21:07 -0600 Subject: [PATCH] fix(storefront): use params.id for the renamed stop-detail route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to 2cf811a: the route folder rename [slug] → [id] updated the file path and the SQL query, but both [id]/page.tsx files still read 'useParams().slug', which Next.js now resolves to undefined. Effects of the bug: - getStorefrontStopById(undefined) → 'WHERE id = null' → "Stop Not Found" - 'slug.includes("indian")' throws on undefined Fix: switch to params.id. Also drop the brand-detection branch ('slug.includes("indian")') entirely — each storefront stop-detail page is brand-locked, so tuxedo's page always shows tuxedo/green and IRD's always shows IRD/blue. The runtime was already dead code because the param is now a UUID. Live-tested: /tuxedo/stops/ and /indian-river-direct/stops/ both return 200 with the correct 'Stop Not Found' state for bogus UUIDs. --- src/app/indian-river-direct/stops/[id]/page.tsx | 5 +---- src/app/tuxedo/stops/[id]/page.tsx | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/indian-river-direct/stops/[id]/page.tsx b/src/app/indian-river-direct/stops/[id]/page.tsx index 6ba0294..835d18c 100644 --- a/src/app/indian-river-direct/stops/[id]/page.tsx +++ b/src/app/indian-river-direct/stops/[id]/page.tsx @@ -36,7 +36,7 @@ type Stop = { export default function StopPage() { const params = useParams(); - const slug = params.slug as string; + const slug = params.id as string; const [stop, setStop] = useState<{ id: string; @@ -57,9 +57,6 @@ export default function StopPage() { if (!result) return; setStop(result.stop as unknown as Stop); - const isIndian = slug.includes("indian"); - setBrandSlug(isIndian ? "indian-river-direct" : "tuxedo"); - setBrandAccent(isIndian ? "blue" : "green"); setProducts(result.products as unknown as Product[]); } load(); diff --git a/src/app/tuxedo/stops/[id]/page.tsx b/src/app/tuxedo/stops/[id]/page.tsx index 9b3a9c1..fbd5544 100644 --- a/src/app/tuxedo/stops/[id]/page.tsx +++ b/src/app/tuxedo/stops/[id]/page.tsx @@ -35,7 +35,7 @@ type Stop = { export default function StopPage() { const params = useParams(); - const slug = params.slug as string; + const slug = params.id as string; const [stop, setStop] = useState<{ id: string; @@ -56,9 +56,6 @@ export default function StopPage() { if (!result) return; setStop(result.stop as unknown as Stop); - const isIndian = slug.includes("indian"); - setBrandSlug(isIndian ? "indian-river-direct" : "tuxedo"); - setBrandAccent(isIndian ? "blue" : "green"); setProducts(result.products as unknown as Product[]); } load();