refactor: migrate all page.server.ts files to typed API client
All server-side fetch calls now go through createApiClient() from $lib/api.server.ts, which wraps openapi-fetch with the generated OpenAPI types. This means backend changes are reflected in the frontend after running npm run generate:api. - Add stub src/lib/generated/api.ts (replaced by generate:api output) - Fix GroupController: missing /api prefix and ResponseStatusException - Root, conversations, persons, documents pages all use typed client - Error handling uses apiError.code directly (no parseBackendError needed) - Edit page load uses typed client; PUT action keeps raw fetch (multipart) - Login keeps raw fetch (explicit Authorization header, not cookie auth) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
frontend/src/lib/generated/api.ts
Normal file
15
frontend/src/lib/generated/api.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* STUB — generated by openapi-typescript
|
||||
*
|
||||
* Run `npm run generate:api` with the backend running in dev mode to
|
||||
* replace this file with fully-typed definitions.
|
||||
*
|
||||
* While this stub is in place the typed client still works; TypeScript
|
||||
* will start enforcing path and parameter correctness once the real
|
||||
* types are generated.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type paths = Record<string, any>;
|
||||
export type components = Record<string, never>;
|
||||
export type operations = Record<string, never>;
|
||||
Reference in New Issue
Block a user