export type DeleteApiApiMartsIdSuppliersSupplierIdArgs = {id: number, supplierId: number}; export type DeleteApiApiMartsIdSuppliersSupplierIdOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /api/marts/{id}/suppliers/{supplierId} */ export const deleteApiApiMartsIdSuppliersSupplierId = async (args: DeleteApiApiMartsIdSuppliersSupplierIdArgs, options: DeleteApiApiMartsIdSuppliersSupplierIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (token !== undefined) headers.set("X-Deluxe-Auth", token) const url = `${baseUrl.replace(/\/+$/, '')}/api/marts/${encodeURIComponent(String(args.id))}/suppliers/${encodeURIComponent(String(args.supplierId))}${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 };