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