You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Frontend: shared typed API client generated from the OpenAPI export (replace ~34 hand-rolled fetch calls) #504
Each call repeats method, headers, credentials, JSON parsing, detail extraction and toast.error, and the calls have already drifted. Browse.tsx sends no credentials, InviteForm sends same-origin, and api_tokens/pages/api.ts sends a CSRF header.
Any cross-cutting change, such as CSRF opt-in, a 401 redirect or request-id propagation, has to touch every call site. Request and response shapes drift silently from the SQLModel DTOs.
Proposal
Add packages/ui/src/lib/api.ts: a typed apiRequest<T>() returning { ok, data, detail, status }, which centralises credentials, the CSRF header and error toasts.
Generate types with openapi-typescript into a packages/api-types workspace, and add a CI drift check (make openapi && git diff --exit-code).
Migrate module by module, starting with tenants and users.
Activity
Typed API client (openapi-fetch + generated types) and typed Inertia …
Typed client for the remaining modules + raw-fetch gate, frontend spl…