diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 09:16:23 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 09:21:46 +0200 |
commit | 1333ab1f2d4ec495084c5368df25610683582ae3 (patch) | |
tree | 4d2b6f5b36d2acfacd5e5f6c3a9d35a9c7101658 /server/controllers/api/videos | |
parent | 1c627fd8d2e60d4d790353886006485343d70084 (diff) | |
download | PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.tar.gz PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.tar.zst PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.zip |
add operationId doc middleware to so API endpoints
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/blacklist.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index ca2b85ea5..530e17965 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -9,6 +9,7 @@ import { | |||
9 | authenticate, | 9 | authenticate, |
10 | blacklistSortValidator, | 10 | blacklistSortValidator, |
11 | ensureUserHasRight, | 11 | ensureUserHasRight, |
12 | openapiOperationDoc, | ||
12 | paginationValidator, | 13 | paginationValidator, |
13 | setBlacklistSort, | 14 | setBlacklistSort, |
14 | setDefaultPagination, | 15 | setDefaultPagination, |
@@ -23,6 +24,7 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c | |||
23 | const blacklistRouter = express.Router() | 24 | const blacklistRouter = express.Router() |
24 | 25 | ||
25 | blacklistRouter.post('/:videoId/blacklist', | 26 | blacklistRouter.post('/:videoId/blacklist', |
27 | openapiOperationDoc({ operationId: 'addVideoBlock' }), | ||
26 | authenticate, | 28 | authenticate, |
27 | ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), | 29 | ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), |
28 | asyncMiddleware(videosBlacklistAddValidator), | 30 | asyncMiddleware(videosBlacklistAddValidator), |
@@ -30,6 +32,7 @@ blacklistRouter.post('/:videoId/blacklist', | |||
30 | ) | 32 | ) |
31 | 33 | ||
32 | blacklistRouter.get('/blacklist', | 34 | blacklistRouter.get('/blacklist', |
35 | openapiOperationDoc({ operationId: 'getVideoBlocks' }), | ||
33 | authenticate, | 36 | authenticate, |
34 | ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), | 37 | ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), |
35 | paginationValidator, | 38 | paginationValidator, |
@@ -48,6 +51,7 @@ blacklistRouter.put('/:videoId/blacklist', | |||
48 | ) | 51 | ) |
49 | 52 | ||
50 | blacklistRouter.delete('/:videoId/blacklist', | 53 | blacklistRouter.delete('/:videoId/blacklist', |
54 | openapiOperationDoc({ operationId: 'delVideoBlock' }), | ||
51 | authenticate, | 55 | authenticate, |
52 | ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), | 56 | ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), |
53 | asyncMiddleware(videosBlacklistRemoveValidator), | 57 | asyncMiddleware(videosBlacklistRemoveValidator), |