export type PatchApiV1PatientCustomFieldsIdArgs = {id: number, body: {field_name: string, datatype: 'string' | 'number' | 'date' | 'time' | 'text' | 'selection' | 'phone' | 'email' | 'address', status?: string | undefined, order?: number | undefined, extra_options?: Record | undefined}}; export type PatchApiV1PatientCustomFieldsIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Edit a custom field * * PATCH /v1/patient_custom_fields/{id} */ export const patchApiV1PatientCustomFieldsId = async (args: PatchApiV1PatientCustomFieldsIdArgs, options?: PatchApiV1PatientCustomFieldsIdOptions) => { const {baseUrl = "https://developer.yezza.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("X-Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/patient_custom_fields/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };