Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 인증코드 type number -> string 변경 #7

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/api/types/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface IPhoneNumber {
}

export interface IPhoneAuth extends IPhoneNumber {
code: number;
code: string;
}

export interface IUserInfo {
Expand All @@ -43,12 +43,12 @@ export interface IEmail {
emailAddress: string;
}
export interface IEmailAuth extends IEmail {
code: number;
code: string;
}

export interface IEmailAuth2 {
emailAddress: string;
code: number;
code: string;
}

export interface ITokenRefresh {
Expand Down
4 changes: 2 additions & 2 deletions src/components/findpassword/EmailCertification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EmailCertification = ({ setStep }: EmailCertificationProps) => {
});

const { mutateAsync: emailVerify } = useMutation(
({ emailAddress, code }: { emailAddress: string; code: number }) => {
({ emailAddress, code }: { emailAddress: string; code: string }) => {
return emailauthverify({ emailAddress, code });
}
);
Expand Down Expand Up @@ -117,7 +117,7 @@ const EmailCertification = ({ setStep }: EmailCertificationProps) => {
try {
const { status } = (await emailVerify({
emailAddress: userEmail,
code: Number(validNumber)
code: validNumber
})) as { status: string };

if (status == 'SUCCESS') {
Expand Down
4 changes: 2 additions & 2 deletions src/components/signup/EmailVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const EmailVerification = ({ onNext }: EmailVerification) => {
});

const { mutateAsync: emailVerify } = useMutation(
({ emailAddress, code }: { emailAddress: string; code: number }) => {
({ emailAddress, code }: { emailAddress: string; code: string }) => {
return emailauthverify({ emailAddress, code });
}
);
Expand Down Expand Up @@ -80,7 +80,7 @@ const EmailVerification = ({ onNext }: EmailVerification) => {
try {
const { status } = (await emailVerify({
emailAddress: userEmail,
code: Number(validNumber)
code: validNumber
})) as { status: string };

if (status == 'SUCCESS') {
Expand Down
9 changes: 7 additions & 2 deletions src/components/signup/PhoneCertification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => {
});

const { mutateAsync: phoneVerify } = useMutation(
({ phoneNumber, code }: { phoneNumber: string; code: number }) => {
({ phoneNumber, code }: { phoneNumber: string; code:string }) => {
return phoneauthverify({ phoneNumber, code });
}
);
Expand Down Expand Up @@ -114,6 +114,8 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => {

if (btnStatus == 'THIRD') {
if (validNumber.length != 6) {
console.log(validNumber)

setValidNumber('');
setErrorMessage('6자리 코드를 입력해주세요.');
inputRef.current?.focus();
Expand All @@ -122,7 +124,7 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => {
try {
const { status } = await phoneVerify({
phoneNumber: phoneNumber.replace(/-/g, ''),
code: Number(validNumber)
code: validNumber
});

if (status == 'SUCCESS') {
Expand All @@ -134,6 +136,9 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => {
const select = signError.find((item) => item.errorCode === errorCode);
if (select) {
setErrorMessage(select.message);
console.log(validNumber);
console.log(parseInt(validNumber, 10));
console.log(Number(validNumber));
setValidNumber('');
inputRef.current?.focus();
return;
Expand Down
Loading