import { isSearchTargetValid } from '@server/helpers/custom-validators/search'
import { isHostValid } from '@server/helpers/custom-validators/servers'
import { areUUIDsValid, isDateValid, isNotEmptyStringArray, toCompleteUUIDs } from '../../helpers/custom-validators/misc'
-import { logger } from '../../helpers/logger'
import { areValidationErrors } from './shared'
const videosSearchValidator = [
.custom(isSearchTargetValid),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videos search query', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
return next()
.custom(isNotEmptyStringArray).withMessage('Should have valid array of handles'),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking video channels search query', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
return next()
.custom(areUUIDsValid).withMessage('Should have valid array of uuid'),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking video playlists search query', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
return next()