export type CreateApiOrdersOrderIdReadyforcollectionArgs = {orderId: string}; export type CreateApiOrdersOrderIdReadyforcollectionOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark order as ready for collection * * POST /orders/{orderId}/readyforcollection */ export const createApiOrdersOrderIdReadyforcollection = async (args: CreateApiOrdersOrderIdReadyforcollectionArgs, options?: CreateApiOrdersOrderIdReadyforcollectionOptions) => { const {baseUrl = "https://uk.api.just-eat.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/orders/${encodeURIComponent(String(args.orderId))}/readyforcollection${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };