} from '../../../middlewares/validators/video-comments'
import { VideoModel } from '../../../models/video/video'
import { VideoCommentModel } from '../../../models/video/video-comment'
+import { auditLoggerFactory, CommentAuditView } from '../../../helpers/audit-logger'
+const auditLogger = auditLoggerFactory('comments')
const videoCommentRouter = express.Router()
videoCommentRouter.get('/:videoId/comment-threads',
}, t)
})
+ auditLogger.create(res.locals.oauth.token.User.Account.Actor.getIdentifier(), new CommentAuditView(comment.toFormattedJSON()))
+
return res.json({
comment: comment.toFormattedJSON()
}).end()
}, t)
})
+ auditLogger.create(res.locals.oauth.token.User.Account.Actor.getIdentifier(), new CommentAuditView(comment.toFormattedJSON()))
+
return res.json({
comment: comment.toFormattedJSON()
}).end()
await videoCommentInstance.destroy({ transaction: t })
})
+ auditLogger.delete(
+ res.locals.oauth.token.User.Account.Actor.getIdentifier(),
+ new CommentAuditView(videoCommentInstance.toFormattedJSON())
+ )
logger.info('Video comment %d deleted.', videoCommentInstance.id)
return res.type('json').status(204).end()