Files
panel/resources/scripts/api/admin/nodes/useNodesSWR.ts
2024-02-04 19:07:14 -06:00

13 lines
369 B
TypeScript

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