mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
New event data screen.
This commit is contained in:
parent
10c438d1de
commit
8ee37d1246
137 changed files with 4918 additions and 321 deletions
20
src/components/hooks/queries/useEventDataEvents.ts
Normal file
20
src/components/hooks/queries/useEventDataEvents.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import useApi from './useApi';
|
||||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
import { useFilterParams } from '../useFilterParams';
|
||||
|
||||
export function useEventDataEvents(
|
||||
websiteId: string,
|
||||
options?: Omit<UseQueryOptions, 'queryKey' | 'queryFn'>,
|
||||
) {
|
||||
const { get, useQuery } = useApi();
|
||||
const params = useFilterParams(websiteId);
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['websites:event-data:events', { websiteId, ...params }],
|
||||
queryFn: () => get(`/websites/${websiteId}/event-data/events`, { ...params }),
|
||||
enabled: !!websiteId,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
||||
export default useEventDataEvents;
|
||||
Loading…
Add table
Add a link
Reference in a new issue