Add drag-and-drop boss reordering and new feature beans

Adds boss battle reorder API endpoint with two-phase order update to
avoid unique constraint violations. Includes frontend mutation hook
and API client. Also adds draft beans for progression dividers and
conditional boss battle teams features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 14:58:49 +01:00
parent a4f814e66e
commit 1bf37a6bd9
6 changed files with 119 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import type {
CreateBossBattleInput,
UpdateBossBattleInput,
BossPokemonInput,
BossReorderItem,
} from '../types'
// Games
@@ -123,5 +124,8 @@ export const updateBossBattle = (gameId: number, bossId: number, data: UpdateBos
export const deleteBossBattle = (gameId: number, bossId: number) =>
api.del(`/games/${gameId}/bosses/${bossId}`)
export const reorderBosses = (gameId: number, bosses: BossReorderItem[]) =>
api.put<BossBattle[]>(`/games/${gameId}/bosses/reorder`, { bosses })
export const setBossTeam = (gameId: number, bossId: number, team: BossPokemonInput[]) =>
api.put<BossBattle>(`/games/${gameId}/bosses/${bossId}/pokemon`, team)