ConvoyPanel/resources/scripts/api/admin/nodes/useNodesSWR.ts
2022-12-16 04:14:52 +00:00

8 lines
No EOL
275 B
TypeScript

import { getNodes, NodeResponse, QueryParams } from '@/api/admin/nodes'
import useSWR from 'swr'
const useNodesSWR = ({page, ...params}: QueryParams) => {
return useSWR<NodeResponse>(['admin:nodes', page], () => getNodes({page, ...params}))
}
export default useNodesSWR