X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-shares.ts;h=f0d8e0c360529712ffb6ae8daf868e0a544938d0;hb=370240824e2fb28b314255f6c23f5ea7d6b08625;hp=ace62be5cade3a1171e6043cd8cad653c356bd05;hpb=c8861d5dc0436ef4342ce517241e3591fa256a13;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-shares.ts b/server/middlewares/validators/videos/video-shares.ts index ace62be5c..f0d8e0c36 100644 --- a/server/middlewares/validators/videos/video-shares.ts +++ b/server/middlewares/validators/videos/video-shares.ts @@ -5,6 +5,7 @@ import { logger } from '../../../helpers/logger' import { VideoShareModel } from '../../../models/video/video-share' import { areValidationErrors } from '../utils' import { doesVideoExist } from '../../../helpers/middlewares' +import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const videosShareValidator = [ param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), @@ -16,11 +17,11 @@ 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) { - return res.status(404) + return res.status(HttpStatusCode.NOT_FOUND_404) .end() }