From 1504628fe28863f3e8500b1bf4b92566eef2ae05 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Wed, 10 Apr 2024 23:00:54 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20code=20=3D>=20status=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Auth/Login/index.tsx | 4 ++-- src/query/auth.ts | 4 ++-- src/store/errorMessageStore.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/page/Auth/Login/index.tsx b/src/page/Auth/Login/index.tsx index 668242a5..72438d62 100644 --- a/src/page/Auth/Login/index.tsx +++ b/src/page/Auth/Login/index.tsx @@ -24,7 +24,7 @@ export default function Login() { const { login, isError: isServerError } = useLogin(); const [isFormError, setIsFormError] = useState(false); const navigate = useNavigate(); - const { loginError, loginErrorCode } = useErrorMessageStore(); + const { loginError, loginErrorStatus } = useErrorMessageStore(); const [emailError, setEmailError] = useState(''); const { value: isModalOpen, changeValue: toggle } = useBooleanState(false); @@ -135,7 +135,7 @@ export default function Login() { - {loginErrorCode === 100005 && isModalOpen && } + {loginErrorStatus === 403 && isModalOpen && } ); } diff --git a/src/query/auth.ts b/src/query/auth.ts index a8d5cf1b..6964998f 100644 --- a/src/query/auth.ts +++ b/src/query/auth.ts @@ -35,7 +35,7 @@ export interface ErrorResponse { export const useLogin = () => { const navigate = useNavigate(); const { setPrevPath } = usePrevPathStore((state) => state); - const { setLoginError, setLoginErrorCode } = useErrorMessageStore(); + const { setLoginError, setLoginErrorStatus } = useErrorMessageStore(); const setStep = useStepStore((state) => state.setStep); const { mutate, error, isError } = useMutation({ @@ -64,7 +64,7 @@ export const useLogin = () => { sessionStorage.removeItem('access_token'); localStorage.removeItem('refresh_token'); setLoginError(err.message || '로그인에 실패했습니다.'); - setLoginErrorCode(err.code); + setLoginErrorStatus(err.status); } }, }); diff --git a/src/store/errorMessageStore.ts b/src/store/errorMessageStore.ts index 648d0040..c3b9ce43 100644 --- a/src/store/errorMessageStore.ts +++ b/src/store/errorMessageStore.ts @@ -7,8 +7,8 @@ interface ErrorMessageStore { setCategoryError: (error: string) => void; loginError: string; setLoginError: (error: string) => void; - loginErrorCode: number; - setLoginErrorCode: (error: number) => void; + loginErrorStatus: number; + setLoginErrorStatus: (error: number) => void; } export const useErrorMessageStore = create((set) => ({ @@ -18,6 +18,6 @@ export const useErrorMessageStore = create((set) => ({ setCategoryError: (error) => set({ categoryError: error }), loginError: '', setLoginError: (error) => set({ loginError: error }), - loginErrorCode: 0, - setLoginErrorCode: (error) => set({ loginErrorCode: error }), + loginErrorStatus: 0, + setLoginErrorStatus: (error) => set({ loginErrorStatus: error }), })); From df190c79fd451407a2d641971bd955be69e42b1a Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Wed, 10 Apr 2024 23:01:32 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20text=20=3D>=20number=20=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/MyShopPage/components/EditShopInfoModal/index.tsx | 2 +- src/page/ShopRegistration/view/Mobile/Sub/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/page/MyShopPage/components/EditShopInfoModal/index.tsx b/src/page/MyShopPage/components/EditShopInfoModal/index.tsx index 041bfa06..f7c6057f 100644 --- a/src/page/MyShopPage/components/EditShopInfoModal/index.tsx +++ b/src/page/MyShopPage/components/EditShopInfoModal/index.tsx @@ -389,7 +389,7 @@ EditShopInfoModalProps) {