12 lines
307 B
TypeScript
12 lines
307 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { getOrganizations } from '../api/adminApi'
|
|
|
|
export const ORGANIZATIONS_QUERY_KEY = ['admin-organizations']
|
|
|
|
export function useOrganizations() {
|
|
return useQuery({
|
|
queryKey: ORGANIZATIONS_QUERY_KEY,
|
|
queryFn: () => getOrganizations(),
|
|
})
|
|
}
|