diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:44:32 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:47:54 +0200 |
commit | 863477173efa82a4412d2e522aa46462249f9199 (patch) | |
tree | 40f0ae28691780d79acef5ba4dbd2ef0694ce8ff /server/middlewares/validators/videos/videos.ts | |
parent | e0faa8ad6e18ce6248ef1ec93a59dab5b05be468 (diff) | |
download | PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.gz PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.zst PeerTube-863477173efa82a4412d2e522aa46462249f9199.zip |
Cleanup tests imports
Diffstat (limited to 'server/middlewares/validators/videos/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 3d93bc62f..7fd2b03d1 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -6,7 +6,7 @@ import { Redis } from '@server/lib/redis' | |||
6 | import { getServerActor } from '@server/models/application/application' | 6 | import { getServerActor } from '@server/models/application/application' |
7 | import { ExpressPromiseHandler } from '@server/types/express-handler' | 7 | import { ExpressPromiseHandler } from '@server/types/express-handler' |
8 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' | 8 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' |
9 | import { getAllPrivacies } from '@shared/core-utils' | 9 | import { arrayify, getAllPrivacies } from '@shared/core-utils' |
10 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude } from '@shared/models' | 10 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude } from '@shared/models' |
11 | import { | 11 | import { |
12 | exists, | 12 | exists, |
@@ -14,7 +14,6 @@ import { | |||
14 | isDateValid, | 14 | isDateValid, |
15 | isFileValid, | 15 | isFileValid, |
16 | isIdValid, | 16 | isIdValid, |
17 | toArray, | ||
18 | toBooleanOrNull, | 17 | toBooleanOrNull, |
19 | toIntOrNull, | 18 | toIntOrNull, |
20 | toValueOrNull | 19 | toValueOrNull |
@@ -419,27 +418,27 @@ function getCommonVideoEditAttributes () { | |||
419 | const commonVideosFiltersValidator = [ | 418 | const commonVideosFiltersValidator = [ |
420 | query('categoryOneOf') | 419 | query('categoryOneOf') |
421 | .optional() | 420 | .optional() |
422 | .customSanitizer(toArray) | 421 | .customSanitizer(arrayify) |
423 | .custom(isNumberArray).withMessage('Should have a valid categoryOneOf array'), | 422 | .custom(isNumberArray).withMessage('Should have a valid categoryOneOf array'), |
424 | query('licenceOneOf') | 423 | query('licenceOneOf') |
425 | .optional() | 424 | .optional() |
426 | .customSanitizer(toArray) | 425 | .customSanitizer(arrayify) |
427 | .custom(isNumberArray).withMessage('Should have a valid licenceOneOf array'), | 426 | .custom(isNumberArray).withMessage('Should have a valid licenceOneOf array'), |
428 | query('languageOneOf') | 427 | query('languageOneOf') |
429 | .optional() | 428 | .optional() |
430 | .customSanitizer(toArray) | 429 | .customSanitizer(arrayify) |
431 | .custom(isStringArray).withMessage('Should have a valid languageOneOf array'), | 430 | .custom(isStringArray).withMessage('Should have a valid languageOneOf array'), |
432 | query('privacyOneOf') | 431 | query('privacyOneOf') |
433 | .optional() | 432 | .optional() |
434 | .customSanitizer(toArray) | 433 | .customSanitizer(arrayify) |
435 | .custom(isNumberArray).withMessage('Should have a valid privacyOneOf array'), | 434 | .custom(isNumberArray).withMessage('Should have a valid privacyOneOf array'), |
436 | query('tagsOneOf') | 435 | query('tagsOneOf') |
437 | .optional() | 436 | .optional() |
438 | .customSanitizer(toArray) | 437 | .customSanitizer(arrayify) |
439 | .custom(isStringArray).withMessage('Should have a valid tagsOneOf array'), | 438 | .custom(isStringArray).withMessage('Should have a valid tagsOneOf array'), |
440 | query('tagsAllOf') | 439 | query('tagsAllOf') |
441 | .optional() | 440 | .optional() |
442 | .customSanitizer(toArray) | 441 | .customSanitizer(arrayify) |
443 | .custom(isStringArray).withMessage('Should have a valid tagsAllOf array'), | 442 | .custom(isStringArray).withMessage('Should have a valid tagsAllOf array'), |
444 | query('nsfw') | 443 | query('nsfw') |
445 | .optional() | 444 | .optional() |