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 ⭐️

554 B
Raw Blame
import {useQuery} from "@tanstack/react-query";
import {IdParam, QueryFilters} from "../types.ts";
import {organizerClient} from "../api/organizer.client.ts";

export const GET_ORGANIZER_EVENTS_QUERY = 'getOrganizerEvents';

export const useGetOrganizerEvents = (organizerId: IdParam, pagination: QueryFilters) => {
    return useQuery({
        queryKey: [GET_ORGANIZER_EVENTS_QUERY, organizerId, pagination],

        queryFn: async () => {
            return await organizerClient.findEventsByOrganizerId(organizerId, pagination);
        }
    });
};