diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-watch.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-watch.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/video-watch.ts b/server/middlewares/validators/videos/video-watch.ts index a0b530c75..d6ca1d341 100644 --- a/server/middlewares/validators/videos/video-watch.ts +++ b/server/middlewares/validators/videos/video-watch.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { body, param } from 'express-validator/check' | 1 | import { body, param } from 'express-validator' |
2 | import * as express from 'express' | 2 | import * as express from 'express' |
3 | import { isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' | 3 | import { isIdOrUUIDValid, toIntOrNull } from '../../../helpers/custom-validators/misc' |
4 | import { areValidationErrors } from '../utils' | 4 | import { areValidationErrors } from '../utils' |
5 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
6 | import { doesVideoExist } from '../../../helpers/middlewares' | 6 | import { doesVideoExist } from '../../../helpers/middlewares' |
@@ -8,7 +8,7 @@ import { doesVideoExist } from '../../../helpers/middlewares' | |||
8 | const videoWatchingValidator = [ | 8 | const videoWatchingValidator = [ |
9 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), | 9 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), |
10 | body('currentTime') | 10 | body('currentTime') |
11 | .toInt() | 11 | .customSanitizer(toIntOrNull) |
12 | .isInt().withMessage('Should have correct current time'), | 12 | .isInt().withMessage('Should have correct current time'), |
13 | 13 | ||
14 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 14 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |