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.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/video-watch.ts b/server/middlewares/validators/videos/video-watch.ts
index ef8b89ece..43306f7cd 100644
--- a/server/middlewares/validators/videos/video-watch.ts
+++ b/server/middlewares/validators/videos/video-watch.ts
@@ -1,12 +1,13 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body, param } from 'express-validator' 2import { body } from 'express-validator'
3import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 3import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
4import { isIdOrUUIDValid, toIntOrNull } from '../../../helpers/custom-validators/misc' 4import { toIntOrNull } from '../../../helpers/custom-validators/misc'
5import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
6import { areValidationErrors, doesVideoExist } from '../shared' 6import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared'
7 7
8const videoWatchingValidator = [ 8const videoWatchingValidator = [
9 param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), 9 isValidVideoIdParam('videoId'),
10
10 body('currentTime') 11 body('currentTime')
11 .customSanitizer(toIntOrNull) 12 .customSanitizer(toIntOrNull)
12 .isInt().withMessage('Should have correct current time'), 13 .isInt().withMessage('Should have correct current time'),