From e2fd7b0c45f24b85519d7ae56a9d839df9d20bda Mon Sep 17 00:00:00 2001 From: lydiacho Date: Thu, 31 Oct 2024 12:59:26 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20API=20=EB=B3=80=EA=B2=BD=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/onboarding/apis/univAxios.ts | 32 +++++++------------ ...4\354\235\274\354\236\205\353\240\245.tsx" | 4 +-- src/pages/onboarding/hooks/useUnivQuery.ts | 18 +++++------ 3 files changed, 23 insertions(+), 31 deletions(-) diff --git a/src/pages/onboarding/apis/univAxios.ts b/src/pages/onboarding/apis/univAxios.ts index bb81bab7..ae949f86 100644 --- a/src/pages/onboarding/apis/univAxios.ts +++ b/src/pages/onboarding/apis/univAxios.ts @@ -1,29 +1,21 @@ -import { axios } from "@utils/apis" +import { axios } from '@utils/apis'; export interface univVerifyPropType { email: string; - univName: string; + univName?: string; code?: string; } export const univVerifyAxios = ({ email, univName }: univVerifyPropType) => { - return axios.post( - '/api/v1/univ/verify', - { - email, - univName, - } - ) + return axios.post('/api/v1/univ/verify', { + univName, + univMail: email, + }); }; - -export const univVerifycodeAxios = ({ email, univName, code }: univVerifyPropType) => { - return axios.post( - '/api/v1/univ/verifycode', - { - email, - univName, - code, - } - ) -}; \ No newline at end of file +export const univVerifycodeAxios = ({ email, code }: univVerifyPropType) => { + return axios.post('/api/v1/univ/verifycode', { + univEmail: email, + verificationCode: code, + }); +}; diff --git "a/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" "b/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" index 9c99a330..d0255092 100644 --- "a/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" +++ "b/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" @@ -99,7 +99,7 @@ const Step이메일입력 = () => { const handleClickButton = () => { verifycodeMutation.mutate( - { email, univName, code }, + { email, code }, { onSuccess: () => { setIsModalOpen(true); @@ -110,7 +110,7 @@ const Step이메일입력 = () => { onError: () => { setIsValidCodeError(true); }, - }, + } ); }; diff --git a/src/pages/onboarding/hooks/useUnivQuery.ts b/src/pages/onboarding/hooks/useUnivQuery.ts index 05e64fbe..310287cf 100644 --- a/src/pages/onboarding/hooks/useUnivQuery.ts +++ b/src/pages/onboarding/hooks/useUnivQuery.ts @@ -1,24 +1,24 @@ -import { univVerifyAxios, univVerifycodeAxios, univVerifyPropType } from "@pages/onboarding/apis/univAxios"; -import { useMutation } from "@tanstack/react-query" +import { univVerifyAxios, univVerifycodeAxios, univVerifyPropType } from '@pages/onboarding/apis/univAxios'; +import { useMutation } from '@tanstack/react-query'; export const useUnivVerify = () => { const mutation = useMutation({ mutationFn: ({ email, univName }: univVerifyPropType) => univVerifyAxios({ email, univName }), onError: (error) => { - console.log('phone verify post Error: ', error); - } + console.error('phone verify post Error: ', error); + }, }); return mutation; -} +}; export const useUnivVerifycode = () => { const mutation = useMutation({ - mutationFn: ({ email, univName, code }: univVerifyPropType) => univVerifycodeAxios({ email, univName, code }), + mutationFn: ({ email, code }: univVerifyPropType) => univVerifycodeAxios({ email, code }), onError: (error) => { - console.log('phone verifycode post Error: ', error); - } + console.error('phone verifycode post Error: ', error); + }, }); return mutation; -} \ No newline at end of file +}; From 465a5785a616305b6ad5b37a14942192f0de216a Mon Sep 17 00:00:00 2001 From: lydiacho Date: Thu, 31 Oct 2024 22:56:20 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=9D=B4=EB=A9=94=EC=9D=BC=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=20=EC=83=88=EB=A1=9C=20=EC=9E=85=EB=A0=A5=20=EC=8B=9C?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=EB=B0=95=EC=8A=A4=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...64\353\251\224\354\235\274\354\236\205\353\240\245.tsx" | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git "a/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" "b/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" index d0255092..fba1c36f 100644 --- "a/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" +++ "b/src/pages/onboarding/components/juniorOnboarding/Step\354\235\264\353\251\224\354\235\274\354\236\205\353\240\245.tsx" @@ -84,6 +84,11 @@ const Step이메일입력 = () => { ); }; + const handleChangeEmail = (e: ChangeEvent) => { + setEmail(e.target.value); + setIsEmailError(false); + }; + const handleChangeCode = (e: ChangeEvent) => { const codeInput = e.target.value; setCode(codeInput); @@ -127,7 +132,7 @@ const Step이메일입력 = () => { label="학교메일" placeholder="메일 주소를 입력해 주세요" value={email} - onChange={(e) => setEmail(e.target.value)} + onChange={handleChangeEmail} isError={isEmailError}>