export type UpdateApiApiV1PlannedIdArgs = {id: string, Authorization: string, body: {title?: string | undefined, items?: Array | undefined}}; export type UpdateApiApiV1PlannedIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update a Planned Card * * PUT /api/v1/planned/{id} */ export const updateApiApiV1PlannedId = async (args: UpdateApiApiV1PlannedIdArgs, options: UpdateApiApiV1PlannedIdOptions) => { 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/planned/${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 };