-
Notifications
You must be signed in to change notification settings - Fork 3
services 및 types 폴더 리팩토링, 로그인/회원가입 hook 리팩토링 #74
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a637933
:recycle: error 페이지 리팩토링
nijesmik 03979b1
:truck: check token api 폴더 이동 #68
nijesmik 0b9034b
:truck: setting api 파일 이동 #68
nijesmik b37f613
:truck: ranking api 파일 이동 #68
nijesmik 40ee204
:recycle: member 로그인 리팩토링
nijesmik 417e0cf
:recycle: guest 로그인 리팩토링
nijesmik 23ab986
:recycle: 회원가입 리팩토링
nijesmik ebbbdd4
:recycle: user hook 리팩토링
nijesmik 7edd122
:fire: 미사용 type 삭제
nijesmik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from './hooks'; | ||
| export { checkToken } from './api'; |
This file contains hidden or 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 hidden or 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,21 @@ | ||
| import { useQueryClient } from '@tanstack/react-query'; | ||
|
|
||
| import { registerMember, upgradeToMember } from './api'; | ||
|
|
||
| import { userQueryKey } from '@/models/user'; | ||
|
|
||
| export const useSignUp = (isGuest: boolean) => { | ||
| const queryClient = useQueryClient(); | ||
|
|
||
| if (!isGuest) { | ||
| return registerMember; | ||
| } | ||
|
|
||
| return async (formData: SignUpForm) => { | ||
| const isSuccess = await upgradeToMember(formData); | ||
| if (isSuccess) { | ||
| await queryClient.invalidateQueries({ queryKey: userQueryKey }); | ||
| } | ||
| return isSuccess; | ||
| }; | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export * from './hooks'; | ||
| export * from './utils'; | ||
| export { queryKey as userQueryKey } from './constants'; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| export const ERROR_MESSAGE = { | ||
| '401': '로그인 정보가 유효하지 않습니다!\n다시 로그인 하시겠습니까?', | ||
| '404': '페이지를 찾을 수 없습니다!\n이전 화면으로 돌아가시겠습니까?', | ||
| '404': '페이지를 찾을 수 없습니다!\n홈으로 돌아가시겠습니까?', | ||
| '500': '서버에 에러가 발생했습니다!\n 개발자에게 문의하세요.', | ||
| '400': '네트워크 연결 상태를\n확인해주세요', | ||
| }; |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 @@ | ||
| type ErrorCode = keyof typeof import('./constants').ERROR_MESSAGE; |
This file contains hidden or 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 hidden or 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 hidden or 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,13 @@ | ||||
| import { client } from '@/shared/api'; | ||||
|
|
||||
| export const getRank = async () => { | ||||
| return client | ||||
| .get<{ | ||||
| refreshTime: string; | ||||
| players: Profile[]; | ||||
| }>('rank/list') | ||||
| .then(({ data }) => { | ||||
| console.debug('rank:', data); | ||||
|
||||
| console.debug('rank:', data); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent data structure:
rightButtonsuses a Set whilemenuButtonuses an array. Consider using Set for both to maintain consistency and improve lookup performance.