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/logs.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/logs.ts')
-rw-r--r-- | server/middlewares/validators/logs.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/logs.ts b/server/middlewares/validators/logs.ts index 584cb2aaf..2d828bb42 100644 --- a/server/middlewares/validators/logs.ts +++ b/server/middlewares/validators/logs.ts | |||
@@ -3,6 +3,7 @@ import { body, query } from 'express-validator' | |||
3 | import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc' | 3 | import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc' |
4 | import { isStringArray } from '@server/helpers/custom-validators/search' | 4 | import { isStringArray } from '@server/helpers/custom-validators/search' |
5 | import { CONFIG } from '@server/initializers/config' | 5 | import { CONFIG } from '@server/initializers/config' |
6 | import { arrayify } from '@shared/core-utils' | ||
6 | import { HttpStatusCode } from '@shared/models' | 7 | import { HttpStatusCode } from '@shared/models' |
7 | import { | 8 | import { |
8 | isValidClientLogLevel, | 9 | isValidClientLogLevel, |
@@ -12,7 +13,7 @@ import { | |||
12 | isValidClientLogUserAgent, | 13 | isValidClientLogUserAgent, |
13 | isValidLogLevel | 14 | isValidLogLevel |
14 | } from '../../helpers/custom-validators/logs' | 15 | } from '../../helpers/custom-validators/logs' |
15 | import { isDateValid, toArray } from '../../helpers/custom-validators/misc' | 16 | import { isDateValid } from '../../helpers/custom-validators/misc' |
16 | import { areValidationErrors } from './shared' | 17 | import { areValidationErrors } from './shared' |
17 | 18 | ||
18 | const createClientLogValidator = [ | 19 | const createClientLogValidator = [ |
@@ -56,7 +57,7 @@ const getLogsValidator = [ | |||
56 | .custom(isValidLogLevel), | 57 | .custom(isValidLogLevel), |
57 | query('tagsOneOf') | 58 | query('tagsOneOf') |
58 | .optional() | 59 | .optional() |
59 | .customSanitizer(toArray) | 60 | .customSanitizer(arrayify) |
60 | .custom(isStringArray).withMessage('Should have a valid one of tags array'), | 61 | .custom(isStringArray).withMessage('Should have a valid one of tags array'), |
61 | query('endDate') | 62 | query('endDate') |
62 | .optional() | 63 | .optional() |