]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/logs.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / logs.ts
index 03c1c4df15bb2ca255864f00cc241ed58f169d88..901d8ca64f684032b7be6ba3de65b12419d01c9d 100644 (file)
@@ -1,7 +1,8 @@
 import express from 'express'
 import { query } from 'express-validator'
+import { isStringArray } from '@server/helpers/custom-validators/search'
 import { isValidLogLevel } from '../../helpers/custom-validators/logs'
-import { isDateValid } from '../../helpers/custom-validators/misc'
+import { isDateValid, toArray } from '../../helpers/custom-validators/misc'
 import { logger } from '../../helpers/logger'
 import { areValidationErrors } from './shared'
 
@@ -11,6 +12,10 @@ const getLogsValidator = [
   query('level')
     .optional()
     .custom(isValidLogLevel).withMessage('Should have a valid level'),
+  query('tagsOneOf')
+    .optional()
+    .customSanitizer(toArray)
+    .custom(isStringArray).withMessage('Should have a valid one of tags array'),
   query('endDate')
     .optional()
     .custom(isDateValid).withMessage('Should have an end date that conforms to ISO 8601'),