export type GetApiRestaurantMenusRestaurantMenuIdArgs = {filter?: unknown | undefined, restaurantMenuId: number}; export type GetApiRestaurantMenusRestaurantMenuIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Fetch restaurant menu * * GET /restaurant_menus/{restaurantMenuId} */ export const getApiRestaurantMenusRestaurantMenuId = async (args: GetApiRestaurantMenusRestaurantMenuIdArgs, options: GetApiRestaurantMenusRestaurantMenuIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.filter != null) query.append("filter", String(args.filter)) const url = `${baseUrl.replace(/\/+$/, '')}/restaurant_menus/${encodeURIComponent(String(args.restaurantMenuId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };