diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-watch.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-watch.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/videos/video-watch.ts b/server/middlewares/validators/videos/video-watch.ts index d6ca1d341..29ce0dab6 100644 --- a/server/middlewares/validators/videos/video-watch.ts +++ b/server/middlewares/validators/videos/video-watch.ts | |||
@@ -4,6 +4,7 @@ import { isIdOrUUIDValid, toIntOrNull } from '../../../helpers/custom-validators | |||
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' |
7 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
7 | 8 | ||
8 | const videoWatchingValidator = [ | 9 | const videoWatchingValidator = [ |
9 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), | 10 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), |
@@ -20,7 +21,7 @@ const videoWatchingValidator = [ | |||
20 | const user = res.locals.oauth.token.User | 21 | const user = res.locals.oauth.token.User |
21 | if (user.videosHistoryEnabled === false) { | 22 | if (user.videosHistoryEnabled === false) { |
22 | logger.warn('Cannot set videos to watch by user %d: videos history is disabled.', user.id) | 23 | logger.warn('Cannot set videos to watch by user %d: videos history is disabled.', user.id) |
23 | return res.status(409).end() | 24 | return res.status(HttpStatusCode.CONFLICT_409).end() |
24 | } | 25 | } |
25 | 26 | ||
26 | return next() | 27 | return next() |