export type GetApiUsersStaffVisitorStatusArgs = {SiteId: number}; export type GetApiUsersStaffVisitorStatusOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets Visitor status for current user login if user is visitor type staff or not * * GET /Users/Staff/VisitorStatus */ export const getApiUsersStaffVisitorStatus = async (args: GetApiUsersStaffVisitorStatusArgs, options?: GetApiUsersStaffVisitorStatusOptions) => { const {baseUrl = "https://api.mindbodyonline.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.SiteId != null) headers.set("SiteId", String(args.SiteId)) const url = `${baseUrl.replace(/\/+$/, '')}/Users/Staff/VisitorStatus${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };