export type CurationCommentCreate = {text: string}; export type CreateApiAccountInstitutionReviewCurationIdCommentsArgs = {curation_id: number, body: CurationCommentCreate}; export type CreateApiAccountInstitutionReviewCurationIdCommentsOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST Institution Curation Review Comment * * POST /account/institution/review/{curation_id}/comments */ export const createApiAccountInstitutionReviewCurationIdComments = async (args: CreateApiAccountInstitutionReviewCurationIdCommentsArgs, options?: CreateApiAccountInstitutionReviewCurationIdCommentsOptions) => { const {baseUrl = "https://api.figshare.com/v2", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/account/institution/review/${encodeURIComponent(String(args.curation_id))}/comments${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };