From dae86118ed5d4026d04acb9d0e36829b9ad8eb4e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Mar 2019 10:35:15 +0100 Subject: Cleanup express locals typings --- server/middlewares/validators/videos/video-watch.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'server/middlewares/validators/videos/video-watch.ts') diff --git a/server/middlewares/validators/videos/video-watch.ts b/server/middlewares/validators/videos/video-watch.ts index a3b70c0cc..a3a800d14 100644 --- a/server/middlewares/validators/videos/video-watch.ts +++ b/server/middlewares/validators/videos/video-watch.ts @@ -4,7 +4,6 @@ import { isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' import { doesVideoExist } from '../../../helpers/custom-validators/videos' import { areValidationErrors } from '../utils' import { logger } from '../../../helpers/logger' -import { UserModel } from '../../../models/account/user' const videoWatchingValidator = [ param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), @@ -18,7 +17,7 @@ const videoWatchingValidator = [ if (areValidationErrors(req, res)) return if (!await doesVideoExist(req.params.videoId, res, 'id')) return - const user = res.locals.oauth.token.User as UserModel + const user = res.locals.oauth.token.User if (user.videosHistoryEnabled === false) { logger.warn('Cannot set videos to watch by user %d: videos history is disabled.', user.id) return res.status(409).end() -- cgit v1.2.3