Change rematch event to change game
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import client from './client'
|
||||
import type { ActiveEvent, MarathonEvent, EventCreate, DroppedAssignment, SwapCandidate, SwapRequestItem, MySwapRequests, CommonEnemyLeaderboardEntry, EventAssignment, CompleteResult } from '@/types'
|
||||
import type { ActiveEvent, MarathonEvent, EventCreate, SwapCandidate, SwapRequestItem, MySwapRequests, CommonEnemyLeaderboardEntry, EventAssignment, CompleteResult, GameChoiceChallenges } from '@/types'
|
||||
|
||||
export const eventsApi = {
|
||||
getActive: async (marathonId: number): Promise<ActiveEvent> => {
|
||||
@@ -46,12 +46,18 @@ export const eventsApi = {
|
||||
await client.delete(`/marathons/${marathonId}/swap-requests/${requestId}`)
|
||||
},
|
||||
|
||||
rematch: async (marathonId: number, assignmentId: number): Promise<void> => {
|
||||
await client.post(`/marathons/${marathonId}/rematch/${assignmentId}`)
|
||||
// Game Choice event
|
||||
getGameChoiceChallenges: async (marathonId: number, gameId: number): Promise<GameChoiceChallenges> => {
|
||||
const response = await client.get<GameChoiceChallenges>(`/marathons/${marathonId}/game-choice/challenges`, {
|
||||
params: { game_id: gameId },
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
getDroppedAssignments: async (marathonId: number): Promise<DroppedAssignment[]> => {
|
||||
const response = await client.get<DroppedAssignment[]>(`/marathons/${marathonId}/dropped-assignments`)
|
||||
selectGameChoiceChallenge: async (marathonId: number, challengeId: number): Promise<{ message: string }> => {
|
||||
const response = await client.post<{ message: string }>(`/marathons/${marathonId}/game-choice/select`, {
|
||||
challenge_id: challengeId,
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user