Улучшение системы оспариваний и исправления
- Оспаривания теперь требуют решения админа после 24ч голосования - Можно повторно оспаривать после разрешённых споров - Исправлены бонусные очки при перепрохождении после оспаривания - Сброс серии при невалидном пруфе - Колесо показывает только доступные игры - Rate limiting только через backend (RATE_LIMIT_ENABLED)
This commit is contained in:
@@ -1,11 +1,28 @@
|
||||
import client from './client'
|
||||
import type { Game, GameStatus, Challenge, ChallengePreview, ChallengesPreviewResponse } from '@/types'
|
||||
import type { Game, GameStatus, GameType, ProofType, Challenge, ChallengePreview, ChallengesPreviewResponse, AvailableGamesCount } from '@/types'
|
||||
|
||||
export interface CreateGameData {
|
||||
title: string
|
||||
download_url: string
|
||||
genre?: string
|
||||
cover_url?: string
|
||||
// Game type fields
|
||||
game_type?: GameType
|
||||
playthrough_points?: number
|
||||
playthrough_description?: string
|
||||
playthrough_proof_type?: ProofType
|
||||
playthrough_proof_hint?: string
|
||||
}
|
||||
|
||||
export interface UpdateGameData {
|
||||
title?: string
|
||||
download_url?: string
|
||||
genre?: string
|
||||
game_type?: GameType
|
||||
playthrough_points?: number
|
||||
playthrough_description?: string
|
||||
playthrough_proof_type?: ProofType
|
||||
playthrough_proof_hint?: string
|
||||
}
|
||||
|
||||
export interface CreateChallengeData {
|
||||
@@ -45,6 +62,21 @@ export const gamesApi = {
|
||||
await client.delete(`/games/${id}`)
|
||||
},
|
||||
|
||||
update: async (id: number, data: UpdateGameData): Promise<Game> => {
|
||||
const response = await client.patch<Game>(`/games/${id}`, data)
|
||||
return response.data
|
||||
},
|
||||
|
||||
getAvailableGamesCount: async (marathonId: number): Promise<AvailableGamesCount> => {
|
||||
const response = await client.get<AvailableGamesCount>(`/marathons/${marathonId}/available-games-count`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
getAvailableGames: async (marathonId: number): Promise<Game[]> => {
|
||||
const response = await client.get<Game[]>(`/marathons/${marathonId}/available-games`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
approve: async (id: number): Promise<Game> => {
|
||||
const response = await client.post<Game>(`/games/${id}/approve`)
|
||||
return response.data
|
||||
|
||||
Reference in New Issue
Block a user