|
|
@ -3,6 +3,7 @@ import DOMPurify from 'isomorphic-dompurify'; |
|
|
|
import { validatePayload } from '../meta/api/helpers'; |
|
|
|
import { validatePayload } from '../meta/api/helpers'; |
|
|
|
import Audit from '../models/Audit'; |
|
|
|
import Audit from '../models/Audit'; |
|
|
|
import Model from '../models/Model'; |
|
|
|
import Model from '../models/Model'; |
|
|
|
|
|
|
|
import { NcError } from '../meta/helpers/catchError'; |
|
|
|
import type { AuditRowUpdateReqType, CommentUpdateReqType } from 'nocodb-sdk'; |
|
|
|
import type { AuditRowUpdateReqType, CommentUpdateReqType } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
|
|
|
|
export async function commentRow(param: { |
|
|
|
export async function commentRow(param: { |
|
|
@ -65,6 +66,7 @@ export async function commentsCount(param: { |
|
|
|
|
|
|
|
|
|
|
|
export async function commentUpdate(param: { |
|
|
|
export async function commentUpdate(param: { |
|
|
|
auditId: string; |
|
|
|
auditId: string; |
|
|
|
|
|
|
|
userEmail: string; |
|
|
|
body: CommentUpdateReqType; |
|
|
|
body: CommentUpdateReqType; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
validatePayload( |
|
|
|
validatePayload( |
|
|
@ -72,5 +74,10 @@ export async function commentUpdate(param: { |
|
|
|
param.body |
|
|
|
param.body |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const log = await Audit.get(param.auditId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (log.user !== param.userEmail) { |
|
|
|
|
|
|
|
NcError.unauthorized('Unauthorized access'); |
|
|
|
|
|
|
|
} |
|
|
|
return await Audit.commentUpdate(param.auditId, param.body); |
|
|
|
return await Audit.commentUpdate(param.auditId, param.body); |
|
|
|
} |
|
|
|
} |
|
|
|