Add filter controls to admin tables
Pokemon (type), Evolutions (trigger), Games (region/generation), and Runs (status/game) now have dropdown filters alongside search. Server-side filtering for paginated tables, client-side for small datasets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,9 +50,10 @@ export const reorderRoutes = (gameId: number, routes: RouteReorderItem[]) =>
|
||||
api.put<Route[]>(`/games/${gameId}/routes/reorder`, { routes })
|
||||
|
||||
// Pokemon
|
||||
export const listPokemon = (search?: string, limit = 50, offset = 0) => {
|
||||
export const listPokemon = (search?: string, limit = 50, offset = 0, type?: string) => {
|
||||
const params = new URLSearchParams()
|
||||
if (search) params.set('search', search)
|
||||
if (type) params.set('type', type)
|
||||
params.set('limit', String(limit))
|
||||
params.set('offset', String(offset))
|
||||
return api.get<PaginatedPokemon>(`/pokemon?${params}`)
|
||||
@@ -80,9 +81,10 @@ export const bulkImportBosses = (gameId: number, items: unknown[]) =>
|
||||
api.post<BulkImportResult>(`/games/${gameId}/bosses/bulk-import`, items)
|
||||
|
||||
// Evolutions
|
||||
export const listEvolutions = (search?: string, limit = 50, offset = 0) => {
|
||||
export const listEvolutions = (search?: string, limit = 50, offset = 0, trigger?: string) => {
|
||||
const params = new URLSearchParams()
|
||||
if (search) params.set('search', search)
|
||||
if (trigger) params.set('trigger', trigger)
|
||||
params.set('limit', String(limit))
|
||||
params.set('offset', String(offset))
|
||||
return api.get<PaginatedEvolutions>(`/evolutions?${params}`)
|
||||
|
||||
Reference in New Issue
Block a user