Added metrics bar and date range to sessions.

This commit is contained in:
Mike Cao 2024-08-07 00:10:25 -07:00
parent 36663bd52d
commit b9068c0050
44 changed files with 859 additions and 739 deletions

View file

@ -1,7 +1,7 @@
import useApi from './useApi';
import { UseQueryOptions } from '@tanstack/react-query';
import { useFilterParams } from '../useFilterParams';
import { useFilterQuery } from 'components/hooks';
import { usePagedQuery } from 'components/hooks';
export function useWebsiteEvents(
websiteId: string,
@ -10,7 +10,7 @@ export function useWebsiteEvents(
const { get } = useApi();
const params = useFilterParams(websiteId);
return useFilterQuery({
return usePagedQuery({
queryKey: ['websites:events', { websiteId, ...params }],
queryFn: pageParams =>
get(`/websites/${websiteId}/events`, { ...params, ...pageParams, pageSize: 20 }),