export type ReadyForPickup = {Event?: 'Ready for pickup' | undefined, Timestamp?: string | undefined}; export type UpdateApiOrderIsReadyForPickupArgs = {body: ReadyForPickup}; export type UpdateApiOrderIsReadyForPickupOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Order ready for pickup * * PUT /order-is-ready-for-pickup */ export const updateApiOrderIsReadyForPickup = async (args: UpdateApiOrderIsReadyForPickupArgs, options?: UpdateApiOrderIsReadyForPickupOptions) => { const {baseUrl = "https://uk.api.just-eat.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/order-is-ready-for-pickup${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };