aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-06-06 10:21:06 +0200
committerRigel Kent <sendmemail@rigelk.eu>2021-06-06 10:21:06 +0200
commitc756bae079e02873f6433582ca14a092fec0db27 (patch)
tree2b24e065144fdb11b8b1ef58ef3157530bd6b2d1 /server/controllers/api/videos/index.ts
parentfc21ef5c62d845576a916414468b3a57370a57b2 (diff)
downloadPeerTube-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/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts23
1 files changed, 19 insertions, 4 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 703051ee2..8c6c44144 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -60,12 +60,25 @@ videosRouter.use('/', liveRouter)
60videosRouter.use('/', uploadRouter) 60videosRouter.use('/', uploadRouter)
61videosRouter.use('/', updateRouter) 61videosRouter.use('/', updateRouter)
62 62
63videosRouter.get('/categories', listVideoCategories) 63videosRouter.get('/categories',
64videosRouter.get('/licences', listVideoLicences) 64 openapiOperationDoc({ operationId: 'getCategories' }),
65videosRouter.get('/languages', listVideoLanguages) 65 listVideoCategories
66videosRouter.get('/privacies', listVideoPrivacies) 66)
67videosRouter.get('/licences',
68 openapiOperationDoc({ operationId: 'getLicences' }),
69 listVideoLicences
70)
71videosRouter.get('/languages',
72 openapiOperationDoc({ operationId: 'getLanguages' }),
73 listVideoLanguages
74)
75videosRouter.get('/privacies',
76 openapiOperationDoc({ operationId: 'getPrivacies' }),
77 listVideoPrivacies
78)
67 79
68videosRouter.get('/', 80videosRouter.get('/',
81 openapiOperationDoc({ operationId: 'getVideos' }),
69 paginationValidator, 82 paginationValidator,
70 videosSortValidator, 83 videosSortValidator,
71 setDefaultVideosSort, 84 setDefaultVideosSort,
@@ -76,6 +89,7 @@ videosRouter.get('/',
76) 89)
77 90
78videosRouter.get('/:id/description', 91videosRouter.get('/:id/description',
92 openapiOperationDoc({ operationId: 'getVideoDesc' }),
79 asyncMiddleware(videosGetValidator), 93 asyncMiddleware(videosGetValidator),
80 asyncMiddleware(getVideoDescription) 94 asyncMiddleware(getVideoDescription)
81) 95)
@@ -91,6 +105,7 @@ videosRouter.get('/:id',
91 asyncMiddleware(getVideo) 105 asyncMiddleware(getVideo)
92) 106)
93videosRouter.post('/:id/views', 107videosRouter.post('/:id/views',
108 openapiOperationDoc({ operationId: 'addView' }),
94 asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')), 109 asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')),
95 asyncMiddleware(viewVideo) 110 asyncMiddleware(viewVideo)
96) 111)