X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-shares.ts;h=20fc962438f591f97c8bb07e62f236b67c6bc44a;hb=298b3fd31529c047e87d34d397af3b08833bd8d0;hp=d5cbdb03ef2ae64eccfdc821f6d844e4bbc03a79;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-shares.ts b/server/middlewares/validators/videos/video-shares.ts index d5cbdb03e..20fc96243 100644 --- a/server/middlewares/validators/videos/video-shares.ts +++ b/server/middlewares/validators/videos/video-shares.ts @@ -1,11 +1,10 @@ import * as express from 'express' -import 'express-validator' -import { param } from 'express-validator/check' +import { param } from 'express-validator' import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc' -import { doesVideoExist } from '../../../helpers/custom-validators/videos' import { logger } from '../../../helpers/logger' import { VideoShareModel } from '../../../models/video/video-share' import { areValidationErrors } from '../utils' +import { doesVideoExist } from '../../../helpers/middlewares' const videosShareValidator = [ param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), @@ -17,7 +16,7 @@ const videosShareValidator = [ if (areValidationErrors(req, res)) return if (!await doesVideoExist(req.params.id, res)) return - const video = res.locals.video + const video = res.locals.videoAll const share = await VideoShareModel.load(req.params.actorId, video.id) if (!share) {