export type CreateApiAuthoringV1ReviewIdCompleteArgs = {id: string}; export type CreateApiAuthoringV1ReviewIdCompleteOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Complete a review. * * POST /authoring/v1/review/{id}/complete */ export const createApiAuthoringV1ReviewIdComplete = async (args: CreateApiAuthoringV1ReviewIdCompleteArgs, options: CreateApiAuthoringV1ReviewIdCompleteOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/authoring/v1/review/${encodeURIComponent(String(args.id))}/complete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };