Introduces full boss battle system: data models (BossBattle, BossPokemon, BossResult), API endpoints for CRUD and per-run defeat tracking, and frontend UI including a sticky level cap bar with badge display on the run page, interleaved boss battle cards in the encounter list, and an admin panel section for managing boss battles and their pokemon teams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
658 B
TypeScript
19 lines
658 B
TypeScript
import { api } from './client'
|
|
import type { BossBattle, BossResult, CreateBossResultInput } from '../types/game'
|
|
|
|
export function getGameBosses(gameId: number): Promise<BossBattle[]> {
|
|
return api.get(`/games/${gameId}/bosses`)
|
|
}
|
|
|
|
export function getBossResults(runId: number): Promise<BossResult[]> {
|
|
return api.get(`/runs/${runId}/boss-results`)
|
|
}
|
|
|
|
export function createBossResult(runId: number, data: CreateBossResultInput): Promise<BossResult> {
|
|
return api.post(`/runs/${runId}/boss-results`, data)
|
|
}
|
|
|
|
export function deleteBossResult(runId: number, resultId: number): Promise<void> {
|
|
return api.del(`/runs/${runId}/boss-results/${resultId}`)
|
|
}
|