Support event type filtering.

This commit is contained in:
Mike Cao 2025-07-24 16:09:49 -07:00
parent 45c9ea9c22
commit 2e69e57445
7 changed files with 39 additions and 29 deletions

View file

@ -4,6 +4,11 @@ import { useDateParameters } from '../useDateParameters';
import { usePagedQuery } from '../usePagedQuery';
import { ReactQueryOptions } from '@/lib/types';
const EVENT_TYPES = {
views: 1,
events: 2,
};
export function useWebsiteEventsQuery(
websiteId: string,
params?: Record<string, any>,
@ -20,7 +25,7 @@ export function useWebsiteEventsQuery(
...date,
...filters,
...pageParams,
...params,
eventType: EVENT_TYPES[params.view],
}),
enabled: !!websiteId,
...options,