+ .catch(err => next(err))
+}
+
+function removeVideo (req: express.Request, res: express.Response) {
+ const videoInstance: VideoInstance = res.locals.video
+
+ return db.sequelize.transaction(t => {
+ return videoInstance.destroy({ transaction: t })
+ })
+ .then(() => {
+ logger.info('Video with name %s and uuid %s deleted.', videoInstance.name, videoInstance.uuid)
+ })
+ .catch(err => {
+ logger.error('Errors when removed the video.', err)
+ throw err
+ })