diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-01-19 13:43:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 13:43:33 +0100 |
commit | 370240824e2fb28b314255f6c23f5ea7d6b08625 (patch) | |
tree | 6d4350fd93ea0b960bd278a948cecbdfbd2b67d7 /server/middlewares/validators | |
parent | 2264c1ceedcf27998108b8f8b706e51ed910d4fb (diff) | |
download | PeerTube-370240824e2fb28b314255f6c23f5ea7d6b08625.tar.gz PeerTube-370240824e2fb28b314255f6c23f5ea7d6b08625.tar.zst PeerTube-370240824e2fb28b314255f6c23f5ea7d6b08625.zip |
Allow users/visitors to search through an account's videos (#3589)
* WIP: account search
* add search to account view
* add tests for account search
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 8bc37b0ab..84e309bec 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -6,6 +6,7 @@ import { MVideoFullLight } from '@server/types/models' | |||
6 | import { ServerErrorCode, UserRight, VideoChangeOwnershipStatus, VideoPrivacy } from '../../../../shared' | 6 | import { ServerErrorCode, UserRight, VideoChangeOwnershipStatus, VideoPrivacy } from '../../../../shared' |
7 | import { VideoChangeOwnershipAccept } from '../../../../shared/models/videos/video-change-ownership-accept.model' | 7 | import { VideoChangeOwnershipAccept } from '../../../../shared/models/videos/video-change-ownership-accept.model' |
8 | import { | 8 | import { |
9 | exists, | ||
9 | isBooleanValid, | 10 | isBooleanValid, |
10 | isDateValid, | 11 | isDateValid, |
11 | isFileFieldValid, | 12 | isFileFieldValid, |
@@ -444,6 +445,9 @@ const commonVideosFiltersValidator = [ | |||
444 | .optional() | 445 | .optional() |
445 | .customSanitizer(toBooleanOrNull) | 446 | .customSanitizer(toBooleanOrNull) |
446 | .custom(isBooleanValid).withMessage('Should have a valid skip count boolean'), | 447 | .custom(isBooleanValid).withMessage('Should have a valid skip count boolean'), |
448 | query('search') | ||
449 | .optional() | ||
450 | .custom(exists).withMessage('Should have a valid search'), | ||
447 | 451 | ||
448 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 452 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
449 | logger.debug('Checking commons video filters query', { parameters: req.query }) | 453 | logger.debug('Checking commons video filters query', { parameters: req.query }) |