diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-06 10:21:06 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-06 10:21:06 +0200 |
commit | c756bae079e02873f6433582ca14a092fec0db27 (patch) | |
tree | 2b24e065144fdb11b8b1ef58ef3157530bd6b2d1 /server/controllers/api/videos/watching.ts | |
parent | fc21ef5c62d845576a916414468b3a57370a57b2 (diff) | |
download | PeerTube-c756bae079e02873f6433582ca14a092fec0db27.tar.gz PeerTube-c756bae079e02873f6433582ca14a092fec0db27.tar.zst PeerTube-c756bae079e02873f6433582ca14a092fec0db27.zip |
add video upload types, add doc middleware to more routes
Diffstat (limited to 'server/controllers/api/videos/watching.ts')
-rw-r--r-- | server/controllers/api/videos/watching.ts | 9 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserWatchingVideo } from '../../../../shared' | 2 | import { UserWatchingVideo } from '../../../../shared' |
3 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoWatchingValidator } from '../../../middlewares' | 3 | import { |
4 | asyncMiddleware, | ||
5 | asyncRetryTransactionMiddleware, | ||
6 | authenticate, | ||
7 | openapiOperationDoc, | ||
8 | videoWatchingValidator | ||
9 | } from '../../../middlewares' | ||
4 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' | 10 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' |
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 11 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' |
6 | 12 | ||
7 | const watchingRouter = express.Router() | 13 | const watchingRouter = express.Router() |
8 | 14 | ||
9 | watchingRouter.put('/:videoId/watching', | 15 | watchingRouter.put('/:videoId/watching', |
16 | openapiOperationDoc({ operationId: 'setProgress' }), | ||
10 | authenticate, | 17 | authenticate, |
11 | asyncMiddleware(videoWatchingValidator), | 18 | asyncMiddleware(videoWatchingValidator), |
12 | asyncRetryTransactionMiddleware(userWatchVideo) | 19 | asyncRetryTransactionMiddleware(userWatchVideo) |