X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fvideos%2Fwatching.ts;h=036e16f3af57ad62a0605e2c1cae2337828db128;hb=1e7eb457eda647b4fa22a0ae8e59c0a618f662f8;hp=e8876b47a09565153533f5c4c9ebcaadde3216c3;hpb=6e46de095d7169355dd83030f6ce4a582304153a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts index e8876b47a..036e16f3a 100644 --- a/server/controllers/api/videos/watching.ts +++ b/server/controllers/api/videos/watching.ts @@ -2,7 +2,6 @@ import * as express from 'express' import { UserWatchingVideo } from '../../../../shared' import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoWatchingValidator } from '../../../middlewares' import { UserVideoHistoryModel } from '../../../models/account/user-video-history' -import { UserModel } from '../../../models/account/user' const watchingRouter = express.Router() @@ -21,10 +20,10 @@ export { // --------------------------------------------------------------------------- async function userWatchVideo (req: express.Request, res: express.Response) { - const user = res.locals.oauth.token.User as UserModel + const user = res.locals.oauth.token.User const body: UserWatchingVideo = req.body - const { id: videoId } = res.locals.video as { id: number } + const { id: videoId } = res.locals.videoId await UserVideoHistoryModel.upsert({ videoId,