- Move api.server.ts, errors.ts, types.ts, utils.ts, relativeTime.ts to lib/shared/ - Move person relationship components to lib/person/relationship/ - Move Stammbaum components to lib/person/genealogy/ - Move HelpPopover to lib/shared/primitives/ - Update all import paths across routes, specs, and lib files - Update vi.mock() paths in server-project test files - Remove now-empty legacy directories (components/, hooks/, server/, etc.) - Update vite.config.ts coverage include paths for new structure - Update frontend/CLAUDE.md to reflect domain-based lib/ layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
657 B
TypeScript
19 lines
657 B
TypeScript
import { error } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
import { createApiClient } from '$lib/shared/api.server';
|
|
import { getErrorMessage } from '$lib/shared/errors';
|
|
|
|
export const load: PageServerLoad = async ({ params, fetch }) => {
|
|
const api = createApiClient(fetch);
|
|
const result = await api.GET('/api/ocr/training-info/{personId}', {
|
|
params: { path: { personId: params.personId } }
|
|
});
|
|
|
|
if (!result.response.ok) {
|
|
const code = (result.error as unknown as { code?: string })?.code;
|
|
throw error(result.response.status, getErrorMessage(code));
|
|
}
|
|
|
|
return { history: result.data!, personId: params.personId };
|
|
};
|