+
+ Notifier.Instance.notifyOnNewComment(comment)
+ auditLogger.create(getAuditIdFromRes(res), new CommentAuditView(comment.toFormattedJSON()))
+
+ Hooks.runAction('action:api.video-comment-reply.created', { comment })
+
+ return res.json({ comment: comment.toFormattedJSON() }).end()
+}
+
+async function removeVideoComment (req: express.Request, res: express.Response) {
+ const videoCommentInstance = 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)
+
+ Hooks.runAction('action:api.video-comment.deleted', { comment: videoCommentInstance })
+
+ return res.type('json').status(204).end()