Spaces:
Configuration error
Configuration error
Download src/components/hooks/queries/useEventDataValues.ts from SreejithSHR/umami: direct link, hf CLI and curl.
- Browser
- Download file 737 Bytes
-
https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/hooks/queries/useEventDataValues.ts
- Command line
-
hf download hf://spaces/SreejithSHR/umami/src/components/hooks/queries/useEventDataValues.ts
-
curl -L -o useEventDataValues.ts https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/hooks/queries/useEventDataValues.ts
737 Bytes
| import { UseQueryOptions } from '@tanstack/react-query'; | |
| import { useApi } from '../useApi'; | |
| import { useFilterParams } from '../useFilterParams'; | |
| export function useEventDataValues( | |
| websiteId: string, | |
| eventName: 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, eventName, propertyName, ...params }], | |
| queryFn: () => | |
| get(`/websites/${websiteId}/event-data/values`, { ...params, eventName, propertyName }), | |
| enabled: !!(websiteId && propertyName), | |
| ...options, | |
| }); | |
| } | |
| export default useEventDataValues; | |