+
+ auditLogger.create(getAuditIdFromRes(res), new CommentAuditView(comment.toFormattedJSON()))
+
+ return res.json({ comment: comment.toFormattedJSON() }).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 })
+ })
+
+ auditLogger.delete(
+ getAuditIdFromRes(res),
+ new CommentAuditView(videoCommentInstance.toFormattedJSON())
+ )
+ logger.info('Video comment %d deleted.', videoCommentInstance.id)
+
+ return res.type('json').status(204).end()