Spaces:
Configuration error
Configuration error
Download src/components/hooks/queries/useSessionDataValues.ts from SreejithSHR/umami: direct link, hf CLI and curl.
- Browser
- Download file 696 Bytes
-
https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/hooks/queries/useSessionDataValues.ts
- Command line
-
hf download hf://spaces/SreejithSHR/umami/src/components/hooks/queries/useSessionDataValues.ts
-
curl -L -o useSessionDataValues.ts https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/hooks/queries/useSessionDataValues.ts
696 Bytes
| import { useApi } from '../useApi'; | |
| import { UseQueryOptions } from '@tanstack/react-query'; | |
| import { useFilterParams } from '../useFilterParams'; | |
| export function useSessionDataValues( | |
| websiteId: string, | |
| propertyName: string, | |
| options?: Omit<UseQueryOptions, 'queryKey' | 'queryFn'>, | |
| ) { | |
| const { get, useQuery } = useApi(); | |
| const params = useFilterParams(websiteId); | |
| return useQuery<any>({ | |
| queryKey: ['websites:session-data:values', { websiteId, propertyName, ...params }], | |
| queryFn: () => get(`/websites/${websiteId}/session-data/values`, { ...params, propertyName }), | |
| enabled: !!(websiteId && propertyName), | |
| ...options, | |
| }); | |
| } | |
| export default useSessionDataValues; | |