feat(ui): add alias management to person edit page
NameHistoryEditCard with add form (type dropdown + name fields), delete with confirmation modal, and IDOR-safe client-side fetch calls. Placed between Personendaten and DangerZone cards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,14 +12,17 @@ export async function load({ params, fetch, locals }) {
|
||||
|
||||
const { id } = params;
|
||||
const api = createApiClient(fetch);
|
||||
const result = await api.GET('/api/persons/{id}', { params: { path: { id } } });
|
||||
const [result, aliasesResult] = await Promise.all([
|
||||
api.GET('/api/persons/{id}', { params: { path: { id } } }),
|
||||
api.GET('/api/persons/{id}/aliases', { params: { path: { id } } })
|
||||
]);
|
||||
|
||||
if (!result.response.ok) {
|
||||
const code = (result.error as unknown as { code?: string })?.code;
|
||||
throw error(result.response.status, getErrorMessage(code));
|
||||
}
|
||||
|
||||
return { person: result.data! };
|
||||
return { person: result.data!, aliases: aliasesResult.data ?? [] };
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
Reference in New Issue
Block a user