-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] axios 에러 응답 수정 및 온보딩 api 연결 로직 리팩토링 (#19)
* feat: 홈화면 ui 및 데이터 페칭 * feat: 홈화면 분기별 ui * feat: 빠른시작 등록, 리스트 * refactor * fix: 라우팅 경로 오류 수정 * feat: 온보딩 api 연결 * refactor: axios 에러 응답 반환 수정 * refactor: 에러처리 * fix: eslint
- Loading branch information
1 parent
be61520
commit 59f1715
Showing
15 changed files
with
156 additions
and
121 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { http } from '@/api' | ||
import { UserInfo } from '@/store/useUserInfo' | ||
import { useMutation } from '@tanstack/react-query' | ||
import { useRouter } from 'next/navigation' | ||
|
||
export const postOnboard = (data: UserInfo) => { | ||
return http.post({ | ||
url: '/members/onboard', | ||
data, | ||
}) | ||
} | ||
|
||
export const usePostOnboard = () => { | ||
const router = useRouter() | ||
|
||
return useMutation({ | ||
mutationFn: (data: UserInfo) => postOnboard(data), | ||
onSuccess: () => { | ||
router.push('/home') | ||
}, | ||
onError: (error) => { | ||
alert(error.message) | ||
}, | ||
}) | ||
} |
Empty file.
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
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
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
Oops, something went wrong.