diff --git a/blotztask-ui/src/app/signup/page.tsx b/blotztask-ui/src/app/signup/page.tsx index b9c21c8..d6074cb 100644 --- a/blotztask-ui/src/app/signup/page.tsx +++ b/blotztask-ui/src/app/signup/page.tsx @@ -40,7 +40,7 @@ const SignUpPage = () => { const handleError = (error: unknown) => { if (error instanceof BadRequestError) { - setError(error.details ? Object.values(error.details).flat().join(' ') : error.message); + setError(error.details ? Object.values(error.details.errors).flat().join(' ') : error.message); } else { console.error('Unexpected error during registration:', error); setError("An unexpected error occurred. Please try again later."); diff --git a/blotztask-ui/src/utils/http-client.ts b/blotztask-ui/src/utils/http-client.ts index 06732a6..b8c16b9 100644 --- a/blotztask-ui/src/utils/http-client.ts +++ b/blotztask-ui/src/utils/http-client.ts @@ -20,7 +20,7 @@ export async function fetchWithErrorHandling( const json = await response.json(); if (response.status === 400) { - throw new BadRequestError(json.errors.title || "Bad Request", json || null); + throw new BadRequestError(json.title || "Bad Request", json || null); } if (response.status >= 500) { throw new ServerError(json.errors.title || "Server Error", json || null);