export type PatchApiCommentTableIdRecordIdCommentIdArgs = {tableId: string, recordId: string, commentId: string, body: {content: Array<{type: 'p', value: unknown, children: Array<{type: 'span', value: string} | {type: 'mention', value: string, name?: string | undefined, avatar?: string | undefined} | {type: 'a', value: unknown, url: string, title: string}>} | {type: 'img', value: unknown, path: string, width?: number | undefined, url?: string | undefined}>}}; export type PatchApiCommentTableIdRecordIdCommentIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * update record comment * * PATCH /comment/{tableId}/{recordId}/{commentId} */ export const patchApiCommentTableIdRecordIdCommentId = async (args: PatchApiCommentTableIdRecordIdCommentIdArgs, options?: PatchApiCommentTableIdRecordIdCommentIdOptions) => { const {baseUrl = "https://app.teable.ai/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/comment/${encodeURIComponent(String(args.tableId))}/${encodeURIComponent(String(args.recordId))}/${encodeURIComponent(String(args.commentId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };