X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-channel-sync.ts;h=7e5b1247177cac9d574c6e52caad858e31fd11c1;hb=cb0eda5602a21d1626a7face32de6153ed07b5f9;hp=081f09bba1bb586c81ef5717a0d1cd52dafeb1a2;hpb=a3b472a12ec6e57dbe2f650419f8064864686eab;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-channel-sync.ts b/server/middlewares/validators/videos/video-channel-sync.ts index 081f09bba..7e5b12471 100644 --- a/server/middlewares/validators/videos/video-channel-sync.ts +++ b/server/middlewares/validators/videos/video-channel-sync.ts @@ -1,7 +1,6 @@ import * as express from 'express' import { body, param } from 'express-validator' import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc' -import { logger } from '@server/helpers/logger' import { CONFIG } from '@server/initializers/config' import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync' import { HttpStatusCode, VideoChannelSyncCreate } from '@shared/models' @@ -20,12 +19,13 @@ export const ensureSyncIsEnabled = (req: express.Request, res: express.Response, } export const videoChannelSyncValidator = [ - body('externalChannelUrl').custom(isUrlValid).withMessage('Should have a valid channel url'), - body('videoChannelId').isInt().withMessage('Should have a valid video channel id'), + body('externalChannelUrl') + .custom(isUrlValid), - async (req: express.Request, res: express.Response, next: express.NextFunction) => { - logger.debug('Checking videoChannelSync parameters', { parameters: req.body }) + body('videoChannelId') + .isInt(), + async (req: express.Request, res: express.Response, next: express.NextFunction) => { if (areValidationErrors(req, res)) return const body: VideoChannelSyncCreate = req.body