1 import express = require('express')
3 const db = require('../../../initializers/database')
4 import { logger } from '../../../helpers'
8 videosBlacklistValidator
9 } from '../../../middlewares'
11 const blacklistRouter = express.Router()
13 blacklistRouter.post('/:id/blacklist',
16 videosBlacklistValidator,
20 // ---------------------------------------------------------------------------
26 // ---------------------------------------------------------------------------
28 function addVideoToBlacklist (req, res, next) {
29 const videoInstance = res.locals.video
32 videoId: videoInstance.id
35 db.BlacklistedVideo.create(toCreate).asCallback(function (err) {
37 logger.error('Errors when blacklisting video ', { error: err })
41 return res.type('json').status(204).end()