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 ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
import {useQuery} from "@tanstack/react-query";
import {Attendee, IdParam} from "../types.ts";
import {attendeeClientPublic} from "../api/attendee.client.ts";
import {AxiosError} from "axios";
export const GET_ATTENDEE_PUBLIC_QUERY_KEY = 'getAttendeePublic';
export const useGetAttendeePublic = (eventId: IdParam, attendeeShortId: string) => {
return useQuery<Partial<Attendee>, AxiosError>({
queryKey: [GET_ATTENDEE_PUBLIC_QUERY_KEY, eventId, attendeeShortId],
queryFn: async () => {
const {data} = await attendeeClientPublic.findByShortId(eventId, attendeeShortId);
return data;
},
refetchOnWindowFocus: false,
retryOnMount: false,
staleTime: 0,
retry: (failureCount, error) => {
if (error?.response?.status === 404) {
return false;
}
return failureCount < 3;
},
});
};