export type DeleteApiMrApiV1CasesIdArgs = {id: string, 'X-Pt-Id': string}; export type DeleteApiMrApiV1CasesIdOptions = {baseUrl?: string | undefined, auth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Case * * DELETE /mr/api/v1/cases/{id} */ export const deleteApiMrApiV1CasesId = async (args: DeleteApiMrApiV1CasesIdArgs, options?: DeleteApiMrApiV1CasesIdOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch, auth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Pt-Id'] != null) headers.set("X-Pt-Id", String(args['X-Pt-Id'])) if (auth !== undefined) headers.set('authorization', `Bearer ${auth}`) const url = `${baseUrl.replace(/\/+$/, '')}/mr/api/v1/cases/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };