Skip to content

Commit

Permalink
Fix: 에러 메시지 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
y-solb committed Jul 7, 2024
1 parent 2eb5ee9 commit 1f7bbaa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/containers/register/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { z } from 'zod'
import { Controller, useForm } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import useOpenAlertModal from '@/hooks/useOpenAlertModal'
import { AxiosError } from 'axios'

interface Form {
displayName: string
Expand Down Expand Up @@ -69,11 +70,10 @@ function RegisterForm() {
onSuccess: (_, variables) => {
router.replace(`/edit/${variables.username}`)
},
onError: () => {
openAlert(
'문제가 발생했어요.',
'회원가입을 처음부터 다시 시도해 주세요.',
)
onError: (error) => {
if (error instanceof AxiosError) {
openAlert('문제가 발생했어요.', error.response?.data.errorMessage)
}
router.replace(`/`)
},
},
Expand Down

0 comments on commit 1f7bbaa

Please sign in to comment.