@@ -21,6 +21,7 @@ import { useMemo } from 'react';
2121import { useTranslation } from 'react-i18next' ;
2222
2323import { getRouteListQueryOptions , useRouteList } from '@/apis/hooks' ;
24+ import type { WithServiceIdFilter } from '@/apis/routes' ;
2425import { DeleteResourceBtn } from '@/components/page/DeleteResourceBtn' ;
2526import PageHeader from '@/components/page/PageHeader' ;
2627import { ToAddPageBtn , ToDetailPageBtn } from '@/components/page/ToAddPageBtn' ;
@@ -33,14 +34,18 @@ import type { ListPageKeys } from '@/utils/useTablePagination';
3334
3435export type RouteListProps = {
3536 routeKey : Extract < ListPageKeys , '/routes/' | '/services/detail/$id/routes/' > ;
37+ defaultParams ?: Partial < WithServiceIdFilter > ;
3638 ToDetailBtn : ( props : {
3739 record : APISIXType [ 'RespRouteItem' ] ;
3840 } ) => React . ReactNode ;
3941} ;
4042
4143export const RouteList = ( props : RouteListProps ) => {
42- const { routeKey, ToDetailBtn } = props ;
43- const { data, isLoading, refetch, pagination } = useRouteList ( routeKey ) ;
44+ const { routeKey, ToDetailBtn, defaultParams } = props ;
45+ const { data, isLoading, refetch, pagination } = useRouteList (
46+ routeKey ,
47+ defaultParams
48+ ) ;
4449 const { t } = useTranslation ( ) ;
4550
4651 const columns = useMemo < ProColumns < APISIXType [ 'RespRouteItem' ] > [ ] > ( ( ) => {
0 commit comments