export type Operation = {path?: (string | null) | undefined, op?: (string | null) | undefined, from?: (string | null) | undefined, value: unknown}; export type PatchApiBankdetailsIdArgs = {id: string, body: Array}; export type PatchApiBankdetailsIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Patches a BankDetails record referenced by ID using JsonPatch. See https://jsonpatch.com/ for details. * * PATCH /bankdetails/{id} */ export const patchApiBankdetailsId = async (args: PatchApiBankdetailsIdArgs, options?: PatchApiBankdetailsIdOptions) => { const {baseUrl = "https://api.iris.co.uk/hr/v2", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/bankdetails/${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 };