export type CreateApiPatientPortalAuthArgs = {body: {country_code?: unknown | undefined, phone?: unknown | undefined}}; export type CreateApiPatientPortalAuthOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * /patient_portal/auth * * POST /patient_portal/auth */ export const createApiPatientPortalAuth = async (args: CreateApiPatientPortalAuthArgs, options?: CreateApiPatientPortalAuthOptions) => { const {baseUrl = "https://api-staging.nimbo.app/api/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/patient_portal/auth${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };