export type UpdateApiApiV1ChangelogIdArgs = {id: string, Authorization: string, body: {title?: string | undefined, items?: Array | undefined, month?: string | undefined, year?: number | undefined}}; export type UpdateApiApiV1ChangelogIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update Changelog * * PUT /api/v1/changelog/{id} */ export const updateApiApiV1ChangelogId = async (args: UpdateApiApiV1ChangelogIdArgs, options: UpdateApiApiV1ChangelogIdOptions) => { 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/changelog/${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 };