export type DeleteApiBudgetsArgs = {id?: string | undefined, unit_amount?: unknown | undefined, currency?: unknown | undefined, timezone?: unknown | undefined, table_id?: string | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined}; export type DeleteApiBudgetsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /budgets */ export const deleteApiBudgets = async (args: DeleteApiBudgetsArgs, options?: DeleteApiBudgetsOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.unit_amount != null) query.append("unit_amount", String(args.unit_amount)) if (args.currency != null) query.append("currency", String(args.currency)) if (args.timezone != null) query.append("timezone", String(args.timezone)) if (args.table_id != null) query.append("table_id", String(args.table_id)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/budgets${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 };