aboutsummaryrefslogtreecommitdiff
path: root/src/components/hooks/queries/useSessionDataQuery.ts
blob: 62b539832541e7697b2ac45b578d0d29b6da17e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { useApi } from '../useApi';

export function useSessionDataQuery(websiteId: string, sessionId: string) {
  const { get, useQuery } = useApi();

  return useQuery({
    queryKey: ['session:data', { websiteId, sessionId }],
    queryFn: () => {
      return get(`/websites/${websiteId}/sessions/${sessionId}/properties`, { websiteId });
    },
  });
}