export type CreateApiDrV1AppointmentAppointmentIdChangeStatusArgs = {auth: string, appointment_id: string, partner_id: string, body: {status?: string | undefined}}; export type CreateApiDrV1AppointmentAppointmentIdChangeStatusOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * No-Show Appointment * * POST /dr/v1/appointment/{appointment_id}/change-status */ export const createApiDrV1AppointmentAppointmentIdChangeStatus = async (args: CreateApiDrV1AppointmentAppointmentIdChangeStatusArgs, options?: CreateApiDrV1AppointmentAppointmentIdChangeStatusOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.auth != null) headers.set("auth", String(args.auth)) if (args.partner_id != null) query.append("partner_id", String(args.partner_id)) const url = `${baseUrl.replace(/\/+$/, '')}/dr/v1/appointment/${encodeURIComponent(String(args.appointment_id))}/change-status${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 };