export type DeleteApiTermintationReasonsTerminationReasonIdOptions = {baseUrl?: string | undefined, XAPIKEY?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete termination reason * * DELETE /termintation_reasons/{termination_reason_id} */ export const deleteApiTermintationReasonsTerminationReasonId = async (options?: DeleteApiTermintationReasonsTerminationReasonIdOptions) => { const {baseUrl = "https://app.peopleforce.io/api/public/v3", fetch: fetchFn = fetch, XAPIKEY} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (XAPIKEY !== undefined) headers.set("X-API-KEY", XAPIKEY) const url = `${baseUrl.replace(/\/+$/, '')}/termintation_reasons/${encodeURIComponent(String(args.termination_reason_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 };