diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 08:57:07 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 09:21:46 +0200 |
commit | 1c627fd8d2e60d4d790353886006485343d70084 (patch) | |
tree | 384fcd80a018eab2ace2a340d028b23359c07dc7 /server/controllers/api/videos/index.ts | |
parent | b96d21b744f3b0714636bd43e7f39fb33c3adb73 (diff) | |
download | PeerTube-1c627fd8d2e60d4d790353886006485343d70084.tar.gz PeerTube-1c627fd8d2e60d4d790353886006485343d70084.tar.zst PeerTube-1c627fd8d2e60d4d790353886006485343d70084.zip |
refactor docMiddleware to support operationId-only form
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r-- | server/controllers/api/videos/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 7671f099e..703051ee2 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import toInt from 'validator/lib/toInt' | 2 | import toInt from 'validator/lib/toInt' |
3 | import { doJSONRequest } from '@server/helpers/requests' | 3 | import { doJSONRequest } from '@server/helpers/requests' |
4 | import { LiveManager } from '@server/lib/live-manager' | 4 | import { LiveManager } from '@server/lib/live-manager' |
5 | import { docMiddleware } from '@server/middlewares/doc' | 5 | import { openapiOperationDoc } from '@server/middlewares/doc' |
6 | import { getServerActor } from '@server/models/application/application' | 6 | import { getServerActor } from '@server/models/application/application' |
7 | import { MVideoAccountLight } from '@server/types/models' | 7 | import { MVideoAccountLight } from '@server/types/models' |
8 | import { VideosCommonQuery } from '../../../../shared' | 8 | import { VideosCommonQuery } from '../../../../shared' |
@@ -84,7 +84,7 @@ videosRouter.get('/:id/metadata/:videoFileId', | |||
84 | asyncMiddleware(getVideoFileMetadata) | 84 | asyncMiddleware(getVideoFileMetadata) |
85 | ) | 85 | ) |
86 | videosRouter.get('/:id', | 86 | videosRouter.get('/:id', |
87 | docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo'), | 87 | openapiOperationDoc({ operationId: 'getVideo' }), |
88 | optionalAuthenticate, | 88 | optionalAuthenticate, |
89 | asyncMiddleware(videosCustomGetValidator('only-video-with-rights')), | 89 | asyncMiddleware(videosCustomGetValidator('only-video-with-rights')), |
90 | asyncMiddleware(checkVideoFollowConstraints), | 90 | asyncMiddleware(checkVideoFollowConstraints), |
@@ -96,7 +96,7 @@ videosRouter.post('/:id/views', | |||
96 | ) | 96 | ) |
97 | 97 | ||
98 | videosRouter.delete('/:id', | 98 | videosRouter.delete('/:id', |
99 | docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/delVideo'), | 99 | openapiOperationDoc({ operationId: 'delVideo' }), |
100 | authenticate, | 100 | authenticate, |
101 | asyncMiddleware(videosRemoveValidator), | 101 | asyncMiddleware(videosRemoveValidator), |
102 | asyncRetryTransactionMiddleware(removeVideo) | 102 | asyncRetryTransactionMiddleware(removeVideo) |