Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

556 B
Raw Blame
import {useQuery} from "@tanstack/react-query";
import {waitlistClient} from "../api/waitlist.client.ts";
import {IdParam, WaitlistStats} from "../types.ts";

export const GET_WAITLIST_STATS_QUERY_KEY = 'getWaitlistStats';

export const useGetWaitlistStats = (eventId: IdParam, eventOccurrenceId?: IdParam | null) => {
    return useQuery<WaitlistStats>({
        queryKey: [GET_WAITLIST_STATS_QUERY_KEY, eventId, eventOccurrenceId],
        queryFn: async () => {
            return waitlistClient.stats(eventId, eventOccurrenceId);
        },
    });
};