aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/videos/video-playlists.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts
index 27ee62b1f..1d67e8666 100644
--- a/server/middlewares/validators/videos/video-playlists.ts
+++ b/server/middlewares/validators/videos/video-playlists.ts
@@ -166,6 +166,18 @@ const videoPlaylistsGetValidator = (fetchType: VideoPlaylistFetchType) => {
166 ] 166 ]
167} 167}
168 168
169const videoPlaylistsSearchValidator = [
170 query('search').optional().not().isEmpty().withMessage('Should have a valid search'),
171
172 (req: express.Request, res: express.Response, next: express.NextFunction) => {
173 logger.debug('Checking videoPlaylists search query', { parameters: req.query })
174
175 if (areValidationErrors(req, res)) return
176
177 return next()
178 }
179]
180
169const videoPlaylistsAddVideoValidator = [ 181const videoPlaylistsAddVideoValidator = [
170 param('playlistId') 182 param('playlistId')
171 .custom(isIdOrUUIDValid).withMessage('Should have a valid playlist id/uuid'), 183 .custom(isIdOrUUIDValid).withMessage('Should have a valid playlist id/uuid'),
@@ -354,6 +366,7 @@ export {
354 videoPlaylistsUpdateValidator, 366 videoPlaylistsUpdateValidator,
355 videoPlaylistsDeleteValidator, 367 videoPlaylistsDeleteValidator,
356 videoPlaylistsGetValidator, 368 videoPlaylistsGetValidator,
369 videoPlaylistsSearchValidator,
357 370
358 videoPlaylistsAddVideoValidator, 371 videoPlaylistsAddVideoValidator,
359 videoPlaylistsUpdateOrRemoveVideoValidator, 372 videoPlaylistsUpdateOrRemoveVideoValidator,