diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-15 09:17:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-15 10:40:06 +0200 |
commit | eae0365b5c5468e51e9795b0e894815ebda86b4a (patch) | |
tree | 5da54b28c94d43d1715a0c69e35eb1cf3a1a959d /server/lib/video-comment.ts | |
parent | 51f636ad0f928bb94069c9143e38df0518f6e4a7 (diff) | |
download | PeerTube-eae0365b5c5468e51e9795b0e894815ebda86b4a.tar.gz PeerTube-eae0365b5c5468e51e9795b0e894815ebda86b4a.tar.zst PeerTube-eae0365b5c5468e51e9795b0e894815ebda86b4a.zip |
Fix missing transactions
Diffstat (limited to 'server/lib/video-comment.ts')
-rw-r--r-- | server/lib/video-comment.ts | 13 |
1 files changed, 3 insertions, 10 deletions
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) { | |||
18 | await sendDeleteVideoComment(videoCommentInstance, t) | 18 | await sendDeleteVideoComment(videoCommentInstance, t) |
19 | } | 19 | } |
20 | 20 | ||
21 | markCommentAsDeleted(videoCommentInstance) | 21 | videoCommentInstance.markAsDeleted() |
22 | 22 | ||
23 | await videoCommentInstance.save() | 23 | await videoCommentInstance.save({ transaction: t }) |
24 | }) | 24 | }) |
25 | 25 | ||
26 | logger.info('Video comment %d deleted.', videoCommentInstance.id) | 26 | logger.info('Video comment %d deleted.', videoCommentInstance.id) |
@@ -95,17 +95,10 @@ function buildFormattedCommentTree (resultList: ResultList<VideoCommentModel>): | |||
95 | return thread | 95 | return thread |
96 | } | 96 | } |
97 | 97 | ||
98 | function markCommentAsDeleted (comment: MComment): void { | ||
99 | comment.text = '' | ||
100 | comment.deletedAt = new Date() | ||
101 | comment.accountId = null | ||
102 | } | ||
103 | |||
104 | // --------------------------------------------------------------------------- | 98 | // --------------------------------------------------------------------------- |
105 | 99 | ||
106 | export { | 100 | export { |
107 | removeComment, | 101 | removeComment, |
108 | createVideoComment, | 102 | createVideoComment, |
109 | buildFormattedCommentTree, | 103 | buildFormattedCommentTree |
110 | markCommentAsDeleted | ||
111 | } | 104 | } |