Add Pokemon detail card with tabbed encounter/evolution views
Pokemon edit modal now shows three tabs (Details, Evolutions, Encounters)
instead of a single long form. Evolution chain entries are clickable to
open the EvolutionFormModal for direct editing. Encounter locations link
to admin route detail pages. Create mode shows only the form (no tabs).
Backend adds GET /pokemon/{id}/encounter-locations (grouped by game) and
GET /pokemon/{id}/evolution-chain (BFS family discovery). Extracts
formatEvolutionMethod to shared utility.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { api } from './client'
|
||||
import type { Pokemon } from '../types/game'
|
||||
import type { EvolutionAdmin, PokemonEncounterLocation } from '../types/admin'
|
||||
|
||||
export function getPokemon(id: number): Promise<Pokemon> {
|
||||
return api.get(`/pokemon/${id}`)
|
||||
@@ -8,3 +9,11 @@ export function getPokemon(id: number): Promise<Pokemon> {
|
||||
export function fetchPokemonFamilies(): Promise<{ families: number[][] }> {
|
||||
return api.get('/pokemon/families')
|
||||
}
|
||||
|
||||
export function fetchPokemonEncounterLocations(pokemonId: number): Promise<PokemonEncounterLocation[]> {
|
||||
return api.get(`/pokemon/${pokemonId}/encounter-locations`)
|
||||
}
|
||||
|
||||
export function fetchPokemonEvolutionChain(pokemonId: number): Promise<EvolutionAdmin[]> {
|
||||
return api.get(`/pokemon/${pokemonId}/evolution-chain`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user