-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor : useMutation으로 api 호출 방식 통일 (#299)
* feat: mutation을 사용하여 훅 분리 * feat: onSubmit에 mutateAsync적용 * feat: formState로 중복 제출 방지 * fix: hook 분리 * fix: 비밀번호 재설정 훅의 api 호출 패턴 통일 * fix: postSignUpMutate 적용 * fix: isPending을 통해 버튼 disabled
- Loading branch information
Showing
15 changed files
with
219 additions
and
155 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { authClient } from '@/apis'; | ||
|
||
import { GetAuthVerificationCheckData } from '../types/Auth.type'; | ||
|
||
interface VerificationCheckParams { | ||
session: string; | ||
} | ||
|
||
export const getAuthVerificationCheck = async ( | ||
verificationCheckParams: VerificationCheckParams | ||
): Promise<GetAuthVerificationCheckData> => { | ||
const res = await authClient.get('/auth/verification/check', { | ||
params: verificationCheckParams, | ||
}); | ||
return res.data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { authClient } from '@/apis'; | ||
|
||
import { PostAuthVerificationEmailData } from '../types/Auth.type'; | ||
|
||
interface EmailVerificationParams { | ||
email: string; | ||
verificationType: 'SIGN_UP' | 'PASSWORD'; | ||
} | ||
|
||
export const postAuthVerificationEmail = async ( | ||
emailVerificationParams: EmailVerificationParams | ||
): Promise<PostAuthVerificationEmailData> => { | ||
const res = await authClient.post(`/auth/verification/email`, emailVerificationParams); | ||
return res.data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 38 additions & 19 deletions
57
src/home/components/SignupContents/EmailAuth/useEmailAuth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.