Add export buttons to all admin panel screens
Backend export endpoints return DB data in seed JSON format (games, routes+encounters, pokemon, evolutions). Frontend downloads the JSON via new Export buttons on each admin page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -83,6 +83,19 @@ export const updateEvolution = (id: number, data: UpdateEvolutionInput) =>
|
||||
export const deleteEvolution = (id: number) =>
|
||||
api.del(`/evolutions/${id}`)
|
||||
|
||||
// Export
|
||||
export const exportGames = () =>
|
||||
api.get<Record<string, unknown>[]>('/export/games')
|
||||
|
||||
export const exportGameRoutes = (gameId: number) =>
|
||||
api.get<{ filename: string; data: unknown }>(`/export/games/${gameId}/routes`)
|
||||
|
||||
export const exportPokemon = () =>
|
||||
api.get<Record<string, unknown>[]>('/export/pokemon')
|
||||
|
||||
export const exportEvolutions = () =>
|
||||
api.get<Record<string, unknown>[]>('/export/evolutions')
|
||||
|
||||
// Route Encounters
|
||||
export const addRouteEncounter = (routeId: number, data: CreateRouteEncounterInput) =>
|
||||
api.post<RouteEncounterDetail>(`/routes/${routeId}/pokemon`, data)
|
||||
|
||||
Reference in New Issue
Block a user