Skip to content

Commit

Permalink
feat: onSubmit에 mutateAsync적용
Browse files Browse the repository at this point in the history
  • Loading branch information
jonique98 committed Sep 2, 2024
1 parent f5a71b5 commit 0f7e591
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/home/components/SignupContents/EmailAuth/useEmailAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,27 @@ export const useEmailAuth = ({ onConfirm, email }: EmailAuthProps) => {

const sendAuthenticationMail = async () => {
setEmailSending(true);
await postAuthVerificationEmailMutation.mutate(
await postAuthVerificationEmailMutation.mutateAsync(
{ email: email, verificationType: 'SIGN_UP' },
{
onSuccess: () => {
setEmailSending(false);
setAuthed(true);
},
onError: () => {
setEmailSending(false);
setAuthed(false);
setError('인증 메일 재전송에 실패했습니다.');
},
}
);
setEmailSending(false);
resetTimer();
};

const onClickNext = async () => {
const session = sessionStorage.getItem(STORAGE_KEYS.EMAIL_AUTH_SESSION_TOKEN);
if (!session) return;

getAuthVerificationCheckMutation.mutate(
await getAuthVerificationCheckMutation.mutateAsync(
{ session: session },
{
onSuccess: (data) => {
Expand Down
3 changes: 2 additions & 1 deletion src/home/components/SignupContents/EmailForm/useEmailForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const useEmailForm = ({ onConfirm }: EmailFormProps) => {

const onEmailSubmit = async () => {
const fullEmail = parseFullEmail(email);
postAuthVerificationEmailMutation.mutate(

await postAuthVerificationEmailMutation.mutateAsync(
{ email: fullEmail, verificationType: 'SIGN_UP' },
{
onSuccess: () => {
Expand Down

0 comments on commit 0f7e591

Please sign in to comment.