mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Separated query string date handling. Fixed all time date.
This commit is contained in:
parent
1def80ba42
commit
b36cd48b4a
7 changed files with 86 additions and 66 deletions
12
src/components/hooks/queries/useDateRangeQuery.ts
Normal file
12
src/components/hooks/queries/useDateRangeQuery.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue