mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-15 09:52:47 +08:00
14 lines
368 B
TypeScript
14 lines
368 B
TypeScript
import useSWR from 'swr'
|
|
|
|
import getLocations, {
|
|
LocationResponse,
|
|
QueryParams,
|
|
} from '@/api/admin/locations/getLocations'
|
|
|
|
const useLocationsSWR = ({ page, query, ...params }: QueryParams) => {
|
|
return useSWR<LocationResponse>(['admin:locations', page, query], () =>
|
|
getLocations({ page, query, ...params })
|
|
)
|
|
}
|
|
|
|
export default useLocationsSWR |