feat(lesereisen): TypeSelector (roving tabindex, aria-disabled), StoryCreate, type-gated new page, list uses GeschichteListRow
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,5 +19,12 @@ export const load: PageServerLoad = async ({ url, fetch, parent }) => {
|
||||
const initialPersons =
|
||||
personResult && personResult.response.ok && personResult.data ? [personResult.data] : [];
|
||||
|
||||
return { initialPersons };
|
||||
// Validate ?type against the known union — prevents unexpected strings from reaching the API.
|
||||
// Security note: strict equality rejects encoded variants (e.g. STORY%00JOURNEY) and
|
||||
// only the FIRST value is returned by searchParams.get() on repeated params.
|
||||
const rawType = url.searchParams.get('type');
|
||||
const selectedType: 'STORY' | 'JOURNEY' | null =
|
||||
rawType === 'STORY' || rawType === 'JOURNEY' ? rawType : null;
|
||||
|
||||
return { initialPersons, selectedType };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user