Skip to content

Commit

Permalink
fix : 변경된 인자명 적용 (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmlim0070 authored Dec 8, 2024
1 parent 05862ac commit 63fe5bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useRegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const useRegisterForm = () => {
try {
const response = await verifyEmail({
email: formState.email,
authNum: formState.authNum
code: formState.authNum
});
const isVerifySuccess = await handleVerifyEmailResponse(response);
if (isVerifySuccess) {
Expand Down
3 changes: 3 additions & 0 deletions src/service/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const defaultApi = (option?: AxiosRequestConfig): AxiosInstance => {
return response;
},
async function (error) {
console.log('액세스 토큰 만료');
console.error('왜지??:', error);

const originalRequest = error.config;

if (error.response?.status === 401 && !originalRequest._retry) {
Expand Down
5 changes: 3 additions & 2 deletions src/service/auth/verifyEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import { VerifyEmailProps, VerifyEmailResponse } from '@/types/register';

export async function verifyEmail({
email,
authNum
code
}: VerifyEmailProps): Promise<VerifyEmailResponse> {
const api = defaultApi();
try {
const response = await api.post('/user/email/verify', {
email,
authNum
code
});
return response.data;
} catch (error) {
console.error('이메일 인증 확인 에러:', error);
if (error instanceof AxiosError && error.response?.data) {
throw error.response.data;
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type SendEmailResponse = ApiResponseType<string>;

export type VerifyEmailProps = {
email: string;
authNum: string;
code: string;
};

export type VerifyEmailResponse = ApiResponseType<null>;
Expand Down

0 comments on commit 63fe5bb

Please sign in to comment.