]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/video-shares.ts
Server: Bulk update videos support field
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / video-shares.ts
index 646d7acb16123b47fd3c2da7a95256ea1ddaac81..d5cbdb03ef2ae64eccfdc821f6d844e4bbc03a79 100644 (file)
@@ -2,11 +2,10 @@ import * as express from 'express'
 import 'express-validator'
 import { param } from 'express-validator/check'
 import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc'
-import { isVideoExist } from '../../../helpers/custom-validators/videos'
+import { doesVideoExist } from '../../../helpers/custom-validators/videos'
 import { logger } from '../../../helpers/logger'
 import { VideoShareModel } from '../../../models/video/video-share'
 import { areValidationErrors } from '../utils'
-import { VideoModel } from '../../../models/video/video'
 
 const videosShareValidator = [
   param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'),
@@ -16,9 +15,9 @@ const videosShareValidator = [
     logger.debug('Checking videoShare parameters', { parameters: req.params })
 
     if (areValidationErrors(req, res)) return
-    if (!await isVideoExist(req.params.id, res)) return
+    if (!await doesVideoExist(req.params.id, res)) return
 
-    const video: VideoModel = res.locals.video
+    const video = res.locals.video
 
     const share = await VideoShareModel.load(req.params.actorId, video.id)
     if (!share) {