-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/#334-redirect
- Loading branch information
Showing
26 changed files
with
578 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
import { | ||
GetCrewRegistrationStatusRequest, | ||
GetRegistrationStatusResponse, | ||
} from '@type/api/member'; | ||
|
||
export const getCrewRegistrationStatus = async ({ | ||
memberId, | ||
crewId, | ||
}: GetCrewRegistrationStatusRequest) => { | ||
const { data } = await axiosInstance.get<GetRegistrationStatusResponse>( | ||
`/members/${memberId}/crews/${crewId}/registration-status` | ||
); | ||
|
||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
import { | ||
GetGameRegistrationStatusRequest, | ||
GetRegistrationStatusResponse, | ||
} from '@type/api/member'; | ||
|
||
export const getGameRegistrationStatus = async ({ | ||
memberId, | ||
gameId, | ||
}: GetGameRegistrationStatusRequest) => { | ||
const { data } = await axiosInstance.get<GetRegistrationStatusResponse>( | ||
`/members/${memberId}/games/${gameId}/registration-status` | ||
); | ||
|
||
return 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
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 |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import { useMutation } from '@tanstack/react-query'; | ||
import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
|
||
import { postCrewParticipate } from '@api/crews/postCrewParticipate'; | ||
|
||
import { useLoginInfoStore } from '@stores/loginInfo.store'; | ||
|
||
export const useCrewParticipateCreateMutation = () => { | ||
const queryClient = useQueryClient(); | ||
const id = useLoginInfoStore((state) => state.loginInfo?.id); | ||
|
||
return useMutation({ | ||
mutationFn: postCrewParticipate, | ||
onSuccess: (_, { crewId }) => { | ||
queryClient.invalidateQueries({ | ||
queryKey: ['crew-detail', crewId], | ||
}); | ||
id && | ||
queryClient.invalidateQueries({ | ||
queryKey: ['crew-registration', id, crewId], | ||
}); | ||
}, | ||
}); | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import { useMutation } from '@tanstack/react-query'; | ||
import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
|
||
import { postGameParticipate } from '@api/games/postGameParticipate'; | ||
|
||
import { useLoginInfoStore } from '@stores/loginInfo.store'; | ||
|
||
export const useGameParticipateCreateMutation = () => { | ||
const queryClient = useQueryClient(); | ||
const id = useLoginInfoStore((state) => state.loginInfo?.id); | ||
|
||
return useMutation({ | ||
mutationFn: postGameParticipate, | ||
onSuccess: (_, { gameId }) => { | ||
queryClient.invalidateQueries({ | ||
queryKey: ['game-detail', gameId], | ||
}); | ||
id && | ||
queryClient.invalidateQueries({ | ||
queryKey: ['game-registration', id, gameId], | ||
}); | ||
}, | ||
}); | ||
}; |
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 { useSuspenseQuery } from '@tanstack/react-query'; | ||
|
||
import { getCrewRegistrationStatus } from '@api/member/getCrewRegistrationStatus'; | ||
|
||
import { GetCrewRegistrationStatusRequest } from '@type/api/member'; | ||
|
||
export const useCrewRegistrationStatusQuery = ({ | ||
memberId, | ||
crewId, | ||
}: GetCrewRegistrationStatusRequest) => { | ||
return useSuspenseQuery({ | ||
queryKey: ['crew-registration', memberId, crewId], | ||
queryFn: () => getCrewRegistrationStatus({ memberId, crewId }), | ||
}); | ||
}; |
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 { useSuspenseQuery } from '@tanstack/react-query'; | ||
|
||
import { getGameRegistrationStatus } from '@api/member/getGameRegistrationStatus'; | ||
|
||
import { GetGameRegistrationStatusRequest } from '@type/api/member'; | ||
|
||
export const useGameRegistrationStatusQuery = ({ | ||
memberId, | ||
gameId, | ||
}: GetGameRegistrationStatusRequest) => { | ||
return useSuspenseQuery({ | ||
queryKey: ['game-registration', memberId, gameId], | ||
queryFn: () => getGameRegistrationStatus({ memberId, gameId }), | ||
}); | ||
}; |
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.