From 1c0b60e9863c0ba40a57c5961f539b20803f8c31 Mon Sep 17 00:00:00 2001 From: kangsinbeom Date: Fri, 28 Jun 2024 17:56:15 +0900 Subject: [PATCH] =?UTF-8?q?HotFix:=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85?= =?UTF-8?q?=20=ED=95=AB=20=ED=94=BD=EC=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/instance.ts | 4 +++- .../signup/components/signupCheck/index.tsx | 22 +++++++++++-------- .../signup/components/signupForm/index.tsx | 9 ++++++-- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/apis/instance.ts b/src/apis/instance.ts index cb4370c..2cfda2d 100644 --- a/src/apis/instance.ts +++ b/src/apis/instance.ts @@ -27,9 +27,11 @@ instance.interceptors.response.use( if (error.response.status === 401 && !originalRequest._retry) { originalRequest._retry = true; try { - const { setMember } = memberStore.getState(); + console.log('hi'); const response = await getNewToken(); const { accessToken } = response.data; + console.log(accessToken); + const { setMember } = memberStore.getState(); setMember(accessToken); originalRequest.headers['Authorization'] = `Bearer ${accessToken}`; return instance(originalRequest); diff --git a/src/pages/signup/components/signupCheck/index.tsx b/src/pages/signup/components/signupCheck/index.tsx index 4b11bad..a9d8790 100644 --- a/src/pages/signup/components/signupCheck/index.tsx +++ b/src/pages/signup/components/signupCheck/index.tsx @@ -2,7 +2,7 @@ import { Timer } from '..'; import { useEffect, useState } from 'react'; import { Button, CircleLoader, InputField } from '@/components'; import usePostEmailVerify from '../../hooks/usePostEmailVerify'; -import { useForm } from 'react-hook-form'; +import { RegisterOptions, useForm } from 'react-hook-form'; import usePostCheckEmailOrNickname, { SignupCheckData, } from '../../hooks/usePostCheckEmailOrNickname'; @@ -13,10 +13,17 @@ export interface SignupCheckProps { label: string; value: 'email' | 'nickname'; buttonLabel: string; + registerOptions: RegisterOptions; successMessage: string; } -const SignupCheck = ({ label, value, buttonLabel, successMessage }: SignupCheckProps) => { +const SignupCheck = ({ + label, + value, + buttonLabel, + successMessage, + registerOptions, +}: SignupCheckProps) => { const { register, formState: { errors }, @@ -34,13 +41,10 @@ const SignupCheck = ({ label, value, buttonLabel, successMessage }: SignupCheckP , + )} error={errors[value]} label={label} value={value} diff --git a/src/pages/signup/components/signupForm/index.tsx b/src/pages/signup/components/signupForm/index.tsx index 8780356..6c151dc 100644 --- a/src/pages/signup/components/signupForm/index.tsx +++ b/src/pages/signup/components/signupForm/index.tsx @@ -1,7 +1,7 @@ import { SignupFormLayout, SignupTextarea } from '..'; import { Button, InputField } from '@/components'; import { ExtendedSignupForm } from '@/types/member'; -import { useFormContext } from 'react-hook-form'; +import { RegisterOptions, useFormContext } from 'react-hook-form'; import { essentiolFormData, optionalFormData } from '@/consts/signup'; import { checkModalStore } from '@/stores/modal'; import { Navigate } from 'react-router-dom'; @@ -50,7 +50,12 @@ const SignupForm = () => { open({ title: props.title, content: ( - + ), }) }