X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-channels.ts;h=ded5d517147dd952bbda0955e9e0db0820f9041a;hb=4024c44f9027a32809931de0692d40d001df721c;hp=0471f6ec4422c48ee374038b63738ff0e6dd13c7;hpb=3e753302d8c911b59971c16a8018df0e1ab78465;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts index 0471f6ec4..ded5d5171 100644 --- a/server/helpers/custom-validators/video-channels.ts +++ b/server/helpers/custom-validators/video-channels.ts @@ -1,9 +1,5 @@ -import * as express from 'express' -import 'express-validator' -import 'multer' -import * as validator from 'validator' +import validator from 'validator' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' -import { VideoChannelModel } from '../../models/video/video-channel' import { exists } from './misc' const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS @@ -25,18 +21,5 @@ function isVideoChannelSupportValid (value: string) { export { isVideoChannelDescriptionValid, isVideoChannelNameValid, - isVideoChannelSupportValid, -} - -function processVideoChannelExist (videoChannel: VideoChannelModel, res: express.Response) { - if (!videoChannel) { - res.status(404) - .json({ error: 'Video channel not found' }) - .end() - - return false - } - - res.locals.videoChannel = videoChannel - return true + isVideoChannelSupportValid }