]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-comment.ts
Fix E2E tests
[github/Chocobozzz/PeerTube.git] / server / lib / video-comment.ts
index 51a9c747ea23ca06ee3b4a2d4610bced805da0ba..c76570a5df3c0b9697f53f40b59fe145f5f12a46 100644 (file)
@@ -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<VideoCommentModel>):
   return thread
 }
 
-function markCommentAsDeleted (comment: MComment): void {
-  comment.text = ''
-  comment.deletedAt = new Date()
-  comment.accountId = null
-}
-
 // ---------------------------------------------------------------------------
 
 export {
   removeComment,
   createVideoComment,
-  buildFormattedCommentTree,
-  markCommentAsDeleted
+  buildFormattedCommentTree
 }