From 5ea162ab93ea08e9dcb53bd1ee43b5f7f95c3870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8B=A4=EB=B9=88?= <991012dabin@gmail.com> Date: Wed, 24 Jan 2024 12:38:16 +0900 Subject: [PATCH 1/2] =?UTF-8?q?modify:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/lib/auth.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/lib/auth.ts b/src/utils/lib/auth.ts index 15a0697a..f271535d 100644 --- a/src/utils/lib/auth.ts +++ b/src/utils/lib/auth.ts @@ -60,13 +60,13 @@ export const getInputOptions = (inputName: string, password?: string) => { } } }; - case 'user_id': + case 'id': return { - required: '아이디를 입력해주세요.', - pattern: { - value: emailRegex, - message: '이메일 형식에 맞게 입력해주세요.' - } + required: '아이디를 입력해주세요.' + }; + case 'password': + return { + required: '비밀번호를 입력해주세요.' }; } }; From 83b93fbab46b45fa9718dccaeb7385b870342a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8B=A4=EB=B9=88?= <991012dabin@gmail.com> Date: Wed, 24 Jan 2024 12:45:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?modify:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Login/LoginForm/index.tsx | 22 +++++++++++----------- src/utils/lib/auth.ts | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/Login/LoginForm/index.tsx b/src/components/Login/LoginForm/index.tsx index eec62c84..efe564b9 100644 --- a/src/components/Login/LoginForm/index.tsx +++ b/src/components/Login/LoginForm/index.tsx @@ -29,7 +29,7 @@ const LoginForm = () => { formState: { errors, isValid }, handleSubmit } = methods; - const isError = !!errors?.user_id || !!errors?.user_password ? true : false; + const isError = !!errors?.login_id || !!errors?.login_password ? true : false; const movetoSignUp = (event: React.MouseEvent) => { event.preventDefault(); @@ -38,8 +38,8 @@ const LoginForm = () => { const onSubmit: SubmitHandler = async data => { const formData: LoginData = { - email: data.user_id, - password: data.user_password + email: data.login_id, + password: data.login_password }; try { const response = await postLogin(formData); @@ -69,26 +69,26 @@ const LoginForm = () => { - {errors.user_id && ( + {errors.login_id && ( - {errors?.user_id?.message?.toString()} + {errors?.login_id?.message?.toString()} )} - {!errors.user_id && errors.user_password && ( + {!errors.login_id && errors.login_password && ( - {errors?.user_password?.message?.toString()} + {errors?.login_password?.message?.toString()} )} diff --git a/src/utils/lib/auth.ts b/src/utils/lib/auth.ts index f271535d..bf45b559 100644 --- a/src/utils/lib/auth.ts +++ b/src/utils/lib/auth.ts @@ -60,11 +60,11 @@ export const getInputOptions = (inputName: string, password?: string) => { } } }; - case 'id': + case 'login_id': return { required: '아이디를 입력해주세요.' }; - case 'password': + case 'login_password': return { required: '비밀번호를 입력해주세요.' };