Part of epic #491. Review nit (B3) on apps/client/src/features/watchlist/components/watchlist-mood-page.tsx:23.
Problem
strict: false on useParams skips route-schema validation. TS cast succeeds at compile time regardless of actual URL. Stale bookmark to /watchlist/moods/unknown-id or renamed mood → passes string not in MOOD_IDS directly to fetchMoodItems → server's moodParamSchema returns 400 → user sees generic error fallback instead of 404.
Fix options
A — runtime guard:
const rawId = useParams({ strict: false });
const moodId = (rawId as { moodId?: string }).moodId as MoodId;
if (!MOOD_IDS.includes(moodId as MoodId)) {
throw notFound();
}
B — declare params: moodParamSchema on the route file and use strict: true here; router enforces before component renders. Preferred if pairs with route-loader migration (#issue-22).
Acceptance criteria
Part of epic #491. Review nit (B3) on
apps/client/src/features/watchlist/components/watchlist-mood-page.tsx:23.Problem
strict: falseonuseParamsskips route-schema validation. TS cast succeeds at compile time regardless of actual URL. Stale bookmark to/watchlist/moods/unknown-idor renamed mood → passes string not inMOOD_IDSdirectly tofetchMoodItems→ server'smoodParamSchemareturns 400 → user sees generic error fallback instead of 404.Fix options
A — runtime guard:
B — declare
params: moodParamSchemaon the route file and usestrict: truehere; router enforces before component renders. Preferred if pairs with route-loader migration (#issue-22).Acceptance criteria
vp check+vp testpass.