export type DeleteApiCoaApiVendorCustomField1IdArgs = {id: number}; export type DeleteApiCoaApiVendorCustomField1IdOptions = {baseUrl?: string | undefined, knoxApiToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Vendor Custom Field * * DELETE /coa/api/vendor_custom_field_1/{id}/ */ export const deleteApiCoaApiVendorCustomField1Id = async (args: DeleteApiCoaApiVendorCustomField1IdArgs, options?: DeleteApiCoaApiVendorCustomField1IdOptions) => { const {baseUrl = "https://api.meetcampfire.com", fetch: fetchFn = fetch, knoxApiToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (knoxApiToken !== undefined) headers.set("Authorization", knoxApiToken) const url = `${baseUrl.replace(/\/+$/, '')}/coa/api/vendor_custom_field_1/${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 };