export type DeleteApiApiV1HrisCustomTablesCustomTableIdFieldsFieldIdArgs = {customTableId: string, fieldId: string}; export type DeleteApiApiV1HrisCustomTablesCustomTableIdFieldsFieldIdOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Custom Table Field * * DELETE /api/v1/hris/custom-tables/{customTableId}/fields/{fieldId} */ export const deleteApiApiV1HrisCustomTablesCustomTableIdFieldsFieldId = async (args: DeleteApiApiV1HrisCustomTablesCustomTableIdFieldsFieldIdArgs, options?: DeleteApiApiV1HrisCustomTablesCustomTableIdFieldsFieldIdOptions) => { const {baseUrl = "https://companySubDomain.bamboohr.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/hris/custom-tables/${encodeURIComponent(String(args.customTableId))}/fields/${encodeURIComponent(String(args.fieldId))}${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 };