export type MealAnnotationRequest = {meal_annotation: string | null}; export type UpdateApiMealPhotoQueueMealPhotoQueueIdMealAnnotationArgs = {meal_photo_queue_id: number, body: MealAnnotationRequest}; export type UpdateApiMealPhotoQueueMealPhotoQueueIdMealAnnotationOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update meal annotation text for a mpq * * PUT /meal_photo_queue/{meal_photo_queue_id}/meal_annotation */ export const updateApiMealPhotoQueueMealPhotoQueueIdMealAnnotation = async (args: UpdateApiMealPhotoQueueMealPhotoQueueIdMealAnnotationArgs, options: UpdateApiMealPhotoQueueMealPhotoQueueIdMealAnnotationOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/meal_photo_queue/${encodeURIComponent(String(args.meal_photo_queue_id))}/meal_annotation${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 };