export type DeleteApiRestaurantAddonsRestaurantAddonIdArgs = {restaurantAddonId: number}; export type DeleteApiRestaurantAddonsRestaurantAddonIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete restaurant addon * * DELETE /restaurant_addons/{restaurantAddonId} */ export const deleteApiRestaurantAddonsRestaurantAddonId = async (args: DeleteApiRestaurantAddonsRestaurantAddonIdArgs, options: DeleteApiRestaurantAddonsRestaurantAddonIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/restaurant_addons/${encodeURIComponent(String(args.restaurantAddonId))}${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 };