aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-watch.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos/video-watch.ts')
-rw-r--r--server/middlewares/validators/videos/video-watch.ts6
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 @@
1import { body, param } from 'express-validator/check' 1import { body, param } from 'express-validator'
2import * as express from 'express' 2import * as express from 'express'
3import { isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' 3import { isIdOrUUIDValid, toIntOrNull } from '../../../helpers/custom-validators/misc'
4import { areValidationErrors } from '../utils' 4import { areValidationErrors } from '../utils'
5import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
6import { doesVideoExist } from '../../../helpers/middlewares' 6import { doesVideoExist } from '../../../helpers/middlewares'
@@ -8,7 +8,7 @@ import { doesVideoExist } from '../../../helpers/middlewares'
8const videoWatchingValidator = [ 8const 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) => {