mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-14 01:12:58 +08:00
13 lines
369 B
TypeScript
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 |