Separated query string date handling. Fixed all time date.
This commit is contained in:
1 parent
1def80ba42
commit
b36cd48b4a
7 files changed
+86
-66
No files matched your search
@@ -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,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user