feat: allow tournament code replacement
This commit is contained in:
1 parent
1272c81fa9
commit
303886ed53
5 files changed
+537
-37
No files matched your search
@@ -41,6 +41,7 @@ import type {
|
||||
RebuildLegacyMatchesResponse,
|
||||
TournamentCodeBulkUploadResponse,
|
||||
TournamentCodeListResponse,
|
||||
TournamentCodeSlotView,
|
||||
TournamentCodeState,
|
||||
TournamentCodeStatsResponse,
|
||||
TournamentCodeUploadItem,
|
||||
@@ -632,6 +633,16 @@ export function useDeleteTournamentCode(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
});
|
||||
}
|
||||
|
||||
export function useReplaceTournamentCode(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
return useMutation({
|
||||
mutationFn: (params: { matchId: string; gameNumber: number }) =>
|
||||
apiFetch<TournamentCodeSlotView>(
|
||||
`/communities/${communityId}/tournament-codes/matches/${params.matchId}/games/${params.gameNumber}/replace`,
|
||||
{ method: 'POST' },
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
export function usePollTournamentResult(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
return useMutation({
|
||||
mutationFn: (matchId: string) =>
|
||||
|
||||
Reference in new issue
Block a user