X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo-comment.ts;h=c76570a5df3c0b9697f53f40b59fe145f5f12a46;hb=450de91e22ba1388e14e12ada875c94e0c38f5d3;hp=51a9c747ea23ca06ee3b4a2d4610bced805da0ba;hpb=eb34ec30e0b57286fc6f85160490d2e973a3b0b1;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts index 51a9c747e..c76570a5d 100644 --- a/server/lib/video-comment.ts +++ b/server/lib/video-comment.ts @@ -18,9 +18,9 @@ async function removeComment (videoCommentInstance: MCommentOwnerVideo) { await sendDeleteVideoComment(videoCommentInstance, t) } - markCommentAsDeleted(videoCommentInstance) + videoCommentInstance.markAsDeleted() - await videoCommentInstance.save() + await videoCommentInstance.save({ transaction: t }) }) logger.info('Video comment %d deleted.', videoCommentInstance.id) @@ -95,17 +95,10 @@ function buildFormattedCommentTree (resultList: ResultList): return thread } -function markCommentAsDeleted (comment: MComment): void { - comment.text = '' - comment.deletedAt = new Date() - comment.accountId = null -} - // --------------------------------------------------------------------------- export { removeComment, createVideoComment, - buildFormattedCommentTree, - markCommentAsDeleted + buildFormattedCommentTree }