+
+async function removeVideoCommentRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const options = {
+ arguments: [ req, res ],
+ errorMessage: 'Cannot remove the video comment with many retries.'
+ }
+
+ await retryTransactionWrapper(removeVideoComment, options)
+
+ return res.type('json').status(204).end()
+}
+
+async function removeVideoComment (req: express.Request, res: express.Response) {
+ const videoCommentInstance: VideoCommentModel = res.locals.videoComment
+
+ await sequelizeTypescript.transaction(async t => {
+ await videoCommentInstance.destroy({ transaction: t })
+ })
+
+ logger.info('Video comment %d deleted.', videoCommentInstance.id)
+}