export type GetApiApiApproveUndoOptimizationIdArgs = {optimization_id: number, t: string}; export type GetApiApiApproveUndoOptimizationIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Approve Undo Start * * GET /api/approve/undo/{optimization_id} */ export const getApiApiApproveUndoOptimizationId = async (args: GetApiApiApproveUndoOptimizationIdArgs, options: GetApiApiApproveUndoOptimizationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/html") if (args.t != null) query.append("t", String(args.t)) const url = `${baseUrl.replace(/\/+$/, '')}/api/approve/undo/${encodeURIComponent(String(args.optimization_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };