export type DeleteApiV1FundsFundArgs = {fund: string | null}; export type DeleteApiV1FundsFundOptions = {baseUrl?: string | undefined, http?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a fund * * DELETE /v1/funds/{fund} */ export const deleteApiV1FundsFund = async (args: DeleteApiV1FundsFundArgs, options?: DeleteApiV1FundsFundOptions) => { const {baseUrl = "https://api.givebutter.com", fetch: fetchFn = fetch, http} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (http !== undefined) headers.set('authorization', `Bearer ${http}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/funds/${encodeURIComponent(String(args.fund))}${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 };