diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-24 11:09:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-24 14:04:05 +0200 |
commit | d411245096b7c9ec06e6fa2ceff7aa7b0fc0c3b7 (patch) | |
tree | 991a4c3e753b2371c8e314fd79ebc134b45659d1 /server/middlewares | |
parent | cddf45035389cc7d9003ea2b64fff3c28cd368d9 (diff) | |
download | PeerTube-d411245096b7c9ec06e6fa2ceff7aa7b0fc0c3b7.tar.gz PeerTube-d411245096b7c9ec06e6fa2ceff7aa7b0fc0c3b7.tar.zst PeerTube-d411245096b7c9ec06e6fa2ceff7aa7b0fc0c3b7.zip |
Add ability to only filter in the search endpoint
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/search.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/middlewares/validators/search.ts b/server/middlewares/validators/search.ts index a97f5b581..e516c4c41 100644 --- a/server/middlewares/validators/search.ts +++ b/server/middlewares/validators/search.ts | |||
@@ -6,7 +6,7 @@ import { isNumberArray, isStringArray, isNSFWQueryValid } from '../../helpers/cu | |||
6 | import { isBooleanValid, isDateValid, toArray } from '../../helpers/custom-validators/misc' | 6 | import { isBooleanValid, isDateValid, toArray } from '../../helpers/custom-validators/misc' |
7 | 7 | ||
8 | const searchValidator = [ | 8 | const searchValidator = [ |
9 | query('search').not().isEmpty().withMessage('Should have a valid search'), | 9 | query('search').optional().not().isEmpty().withMessage('Should have a valid search'), |
10 | 10 | ||
11 | query('startDate').optional().custom(isDateValid).withMessage('Should have a valid start date'), | 11 | query('startDate').optional().custom(isDateValid).withMessage('Should have a valid start date'), |
12 | query('endDate').optional().custom(isDateValid).withMessage('Should have a valid end date'), | 12 | query('endDate').optional().custom(isDateValid).withMessage('Should have a valid end date'), |