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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user