export type DeleteApiApiV1CapOffersCapOfferIdArgs = {cap_offer_id: string}; export type DeleteApiApiV1CapOffersCapOfferIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete cap offer * * DELETE /api/v1/cap-offers/{cap_offer_id} */ export const deleteApiApiV1CapOffersCapOfferId = async (args: DeleteApiApiV1CapOffersCapOfferIdArgs, options: DeleteApiApiV1CapOffersCapOfferIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/cap-offers/${encodeURIComponent(String(args.cap_offer_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 };