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:
@@ -21,10 +21,10 @@ import type {
|
||||
|
||||
// --- Queries ---
|
||||
|
||||
export function usePokemonList(search?: string, limit = 50, offset = 0) {
|
||||
export function usePokemonList(search?: string, limit = 50, offset = 0, type?: string) {
|
||||
return useQuery({
|
||||
queryKey: ['pokemon', { search, limit, offset }],
|
||||
queryFn: () => adminApi.listPokemon(search, limit, offset),
|
||||
queryKey: ['pokemon', { search, limit, offset, type }],
|
||||
queryFn: () => adminApi.listPokemon(search, limit, offset, type),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -213,10 +213,10 @@ export function useBulkImportBosses(gameId: number) {
|
||||
|
||||
// --- Evolution Queries & Mutations ---
|
||||
|
||||
export function useEvolutionList(search?: string, limit = 50, offset = 0) {
|
||||
export function useEvolutionList(search?: string, limit = 50, offset = 0, trigger?: string) {
|
||||
return useQuery({
|
||||
queryKey: ['evolutions', { search, limit, offset }],
|
||||
queryFn: () => adminApi.listEvolutions(search, limit, offset),
|
||||
queryKey: ['evolutions', { search, limit, offset, trigger }],
|
||||
queryFn: () => adminApi.listEvolutions(search, limit, offset, trigger),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user