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 ] 후배 학교 메일 인증 API 변경사항 반영 #332

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
32 changes: 12 additions & 20 deletions src/pages/onboarding/apis/univAxios.ts
Original file line number Diff line number Diff line change
@@ -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,
}
)
};
export const univVerifycodeAxios = ({ email, code }: univVerifyPropType) => {
return axios.post('/api/v1/univ/verifycode', {
univEmail: email,
verificationCode: code,
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Step이메일입력 = () => {

const handleClickButton = () => {
verifycodeMutation.mutate(
{ email, univName, code },
{ email, code },
{
onSuccess: () => {
setIsModalOpen(true);
Expand All @@ -110,7 +110,7 @@ const Step이메일입력 = () => {
onError: () => {
setIsValidCodeError(true);
},
},
}
);
};

Expand Down
18 changes: 9 additions & 9 deletions src/pages/onboarding/hooks/useUnivQuery.ts
Original file line number Diff line number Diff line change
@@ -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;
}
};
Loading