Spaces:
Configuration error
Configuration error
Download src/components/hooks/queries/useSessionActivity.ts from SreejithSHR/umami: direct link, hf CLI and curl.
- Browser
- Download file 562 Bytes
-
https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/hooks/queries/useSessionActivity.ts
- Command line
-
hf download hf://spaces/SreejithSHR/umami/src/components/hooks/queries/useSessionActivity.ts
-
curl -L -o useSessionActivity.ts https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/hooks/queries/useSessionActivity.ts
562 Bytes
| import { useApi } from '../useApi'; | |
| export function useSessionActivity( | |
| websiteId: string, | |
| sessionId: string, | |
| startDate: Date, | |
| endDate: Date, | |
| ) { | |
| const { get, useQuery } = useApi(); | |
| return useQuery({ | |
| queryKey: ['session:activity', { websiteId, sessionId, startDate, endDate }], | |
| queryFn: () => { | |
| return get(`/websites/${websiteId}/sessions/${sessionId}/activity`, { | |
| startAt: +new Date(startDate), | |
| endAt: +new Date(endDate), | |
| }); | |
| }, | |
| enabled: Boolean(websiteId && sessionId && startDate && endDate), | |
| }); | |
| } | |