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'
}
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