aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/watching.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/watching.ts')
-rw-r--r--server/controllers/api/videos/watching.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts
index 08190e583..8b15525aa 100644
--- a/server/controllers/api/videos/watching.ts
+++ b/server/controllers/api/videos/watching.ts
@@ -1,12 +1,19 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserWatchingVideo } from '../../../../shared' 2import { UserWatchingVideo } from '../../../../shared'
3import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoWatchingValidator } from '../../../middlewares' 3import {
4 asyncMiddleware,
5 asyncRetryTransactionMiddleware,
6 authenticate,
7 openapiOperationDoc,
8 videoWatchingValidator
9} from '../../../middlewares'
4import { UserVideoHistoryModel } from '../../../models/user/user-video-history' 10import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
5import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 11import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
6 12
7const watchingRouter = express.Router() 13const watchingRouter = express.Router()
8 14
9watchingRouter.put('/:videoId/watching', 15watchingRouter.put('/:videoId/watching',
16 openapiOperationDoc({ operationId: 'setProgress' }),
10 authenticate, 17 authenticate,
11 asyncMiddleware(videoWatchingValidator), 18 asyncMiddleware(videoWatchingValidator),
12 asyncRetryTransactionMiddleware(userWatchVideo) 19 asyncRetryTransactionMiddleware(userWatchVideo)