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

564 B
Raw Blame
import {useQuery} from "@tanstack/react-query";
import {IdParam} from "../types.ts";
import {lineupClient, Profile} from "../api/lineup.client.ts";

export const GET_PROFILES_QUERY_KEY = 'getProfiles';

export const useGetProfiles = (organizerId: IdParam | undefined) => {
    return useQuery<Profile[]>({
        queryKey: [GET_PROFILES_QUERY_KEY, String(organizerId)],
        queryFn: async () => {
            const {data} = await lineupClient.getProfiles(organizerId as IdParam);
            return data;
        },
        enabled: !!organizerId,
    });
};