From eae0365b5c5468e51e9795b0e894815ebda86b4a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 15 Jun 2021 09:17:19 +0200 Subject: Fix missing transactions --- server/lib/video-comment.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'server/lib/video-comment.ts') 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 } -- cgit v1.2.3