fix(unit-2-auth): Fix API endpoint paths and JSON casing for real backend

- Add /api/v1/ prefix to all Unit 2 API calls (Setup/status, Setup/owner,
  Invitation/validate, Invitation/complete) to match backend ApiPrefixConvention
- Fix setup status endpoint to POST /api/v1/Setup/owner (not /Setup)
- Handle PascalCase 'Initialized' response from .NET backend without camelCase policy
- Update all MSW mock handlers to match corrected /api/v1/ URL patterns
- Remove unused imports from RouteGuard.test.tsx

Root cause: backend uses ApiPrefixConvention('api/v1') but frontend calls
were missing the prefix, and .NET defaults to PascalCase JSON serialization.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 10:55:34 +02:00
co-authored by Claude Haiku 4.5
parent c9cd0ff457
commit 8d95754ece
6 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ export function useValidateInvitation(token: string | null) {
setIsPending(true);
setError(null);
try {
const url = `/Invitation/validate?token=${encodeURIComponent(token)}`;
const url = `/api/v1/Invitation/validate?token=${encodeURIComponent(token)}`;
const response = await api.get(url);
setData(response as InvitationValidationResponse);
} catch (err: unknown) {
@@ -64,7 +64,7 @@ export function useCompleteInvitation() {
setIsPending(true);
setError(null);
try {
const response = await api.post('/Invitation/complete', data);
const response = await api.post('/api/v1/Invitation/complete', data);
return response as InvitationCompleteResponse;
} catch (err: unknown) {
const error = err instanceof Error ? err : new Error(String(err));