From e4c556196d7b31111f17596840d2e1d60caa7dcb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 31 Jul 2016 20:58:43 +0200 Subject: Server: reorganize express validators --- server/middlewares/validators/videos.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/videos.js b/server/middlewares/validators/videos.js index 3e2af06fb..422f3642f 100644 --- a/server/middlewares/validators/videos.js +++ b/server/middlewares/validators/videos.js @@ -4,7 +4,7 @@ const mongoose = require('mongoose') const checkErrors = require('./utils').checkErrors const constants = require('../../initializers/constants') -const customValidators = require('../../helpers/custom-validators') +const customVideosValidators = require('../../helpers/custom-validators').videos const logger = require('../../helpers/logger') const Video = mongoose.model('Video') @@ -33,8 +33,8 @@ function videosAdd (req, res, next) { return res.status(400).send('Cannot retrieve metadata of the file.') } - if (!customValidators.isVideoDurationValid(duration)) { - return res.status(400).send('Duration of the video file is too big (max: ' + constants.VIDEOS_CONSTRAINTS_FIELDS.DURATION.max + 's).') + if (!customVideosValidators.isVideoDurationValid(duration)) { + return res.status(400).send('Duration of the video file is too big (max: ' + constants.CONSTRAINTS_FIELDS.VIDEOS.DURATION.max + 's).') } videoFile.duration = duration -- cgit v1.2.3