mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 10:05:36 +01:00
12 lines
384 B
TypeScript
12 lines
384 B
TypeScript
import { useApi } from '../useApi';
|
|
import { ReactQueryOptions } from '@/lib/types';
|
|
|
|
export function useDateRangeQuery(websiteId: string, options?: ReactQueryOptions) {
|
|
const { get, useQuery } = useApi();
|
|
return useQuery<any>({
|
|
queryKey: ['date-range', websiteId],
|
|
queryFn: () => get(`/websites/${websiteId}/daterange`),
|
|
enabled: !!websiteId,
|
|
...options,
|
|
});
|
|
}
|