export type UpdateApiApiV1InProgressIdArgs = {id: string, Authorization: string, body: {title?: string | undefined, items?: Array | undefined, completionPercentage?: number | undefined}}; export type UpdateApiApiV1InProgressIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update In Progress Card * * PUT /api/v1/in-progress/{id} */ export const updateApiApiV1InProgressId = async (args: UpdateApiApiV1InProgressIdArgs, options: UpdateApiApiV1InProgressIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/in-progress/${encodeURIComponent(String(args.id))}${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 (await res.json()) as unknown };