Renamed id routes for API.

This commit is contained in:
Mike Cao 2024-01-31 22:08:48 -08:00
parent 53a991176b
commit 4429198397
42 changed files with 154 additions and 170 deletions

View file

@ -4,7 +4,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
export function useWebsiteMetrics(
websiteId: string,
params?: { [key: string]: any },
options?: Omit<UseQueryOptions, 'queryKey' | 'queryFn'>,
options?: Omit<UseQueryOptions & { onDataLoad?: (data: any) => void }, 'queryKey' | 'queryFn'>,
) {
const { get, useQuery } = useApi();
@ -25,6 +25,8 @@ export function useWebsiteMetrics(
...filters,
});
options?.onDataLoad?.(data);
return data;
},
...options,