aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/logs.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 15:44:32 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 15:47:54 +0200
commit863477173efa82a4412d2e522aa46462249f9199 (patch)
tree40f0ae28691780d79acef5ba4dbd2ef0694ce8ff /server/middlewares/validators/logs.ts
parente0faa8ad6e18ce6248ef1ec93a59dab5b05be468 (diff)
downloadPeerTube-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.ts5
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'
3import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc' 3import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc'
4import { isStringArray } from '@server/helpers/custom-validators/search' 4import { isStringArray } from '@server/helpers/custom-validators/search'
5import { CONFIG } from '@server/initializers/config' 5import { CONFIG } from '@server/initializers/config'
6import { arrayify } from '@shared/core-utils'
6import { HttpStatusCode } from '@shared/models' 7import { HttpStatusCode } from '@shared/models'
7import { 8import {
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'
15import { isDateValid, toArray } from '../../helpers/custom-validators/misc' 16import { isDateValid } from '../../helpers/custom-validators/misc'
16import { areValidationErrors } from './shared' 17import { areValidationErrors } from './shared'
17 18
18const createClientLogValidator = [ 19const 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()