Skip to content

Commit

Permalink
sign-up page fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kralsolomon committed Jun 12, 2024
1 parent e847964 commit fbb0c26
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/user/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,9 @@ export default function SignUp() {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(values),
})

if (!response.ok) {
let errorData = await response.json()

toast.error('Signup error', {
description: errorData.error,
})
throw new Error(errorData.error)
}

toast('Signup successful!', {
Expand All @@ -79,8 +75,10 @@ export default function SignUp() {
},
})
router.push('/')
} catch (error) {
toast.error('ERROR', { description: 'An error occurred while trying to Sign up.' })
} catch (error: any) {
toast.error('Signup error', {
description: error.message,
})
}
}

Expand Down

0 comments on commit fbb0c26

Please sign in to comment.