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

486 B
Raw Blame
import {PublicWidget, widgetClientPublic} from "../api/widget.client.ts";

export const GET_WIDGET_PUBLIC_QUERY_KEY = 'getWidgetPublic';

export const getWidgetPublicQuery = (shortId: string) => ({
    queryKey: [GET_WIDGET_PUBLIC_QUERY_KEY, shortId] as const,
    queryFn: async (): Promise<PublicWidget> => {
        const {data} = await widgetClientPublic.get(shortId);
        return data;
    },
    staleTime: 5 * 60 * 1000,
    retry: false,
    refetchOnWindowFocus: false,
});