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

589 B
Raw Blame
import {useQuery, UseQueryResult} from "@tanstack/react-query";
import {authClient} from "../api/auth.client.ts";
import {GenericDataResponse, Invitation} from "../types.ts";
import {AxiosError} from "axios";

export const GET_INVITATION_QUERY_KEY = 'getInvitation';

export const useGetInvitation = (token: string): UseQueryResult<GenericDataResponse<Invitation>, AxiosError> => {
    return useQuery({
        queryKey: [GET_INVITATION_QUERY_KEY, token],

        queryFn: async () => {
            return await authClient.getInvitation(token);
        },

        retry: false
    });
}