]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/logs.ts
improve api param message for dates
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / logs.ts
index 70e4d0d99de196caf5af73910c9a905ecd7c901a..ba817d9a9e19a418d297511883be3119aa29977a 100644 (file)
@@ -7,13 +7,13 @@ import { isValidLogLevel } from '../../helpers/custom-validators/logs'
 
 const getLogsValidator = [
   query('startDate')
-    .custom(isDateValid).withMessage('Should have a valid start date'),
+    .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'),
   query('level')
     .optional()
     .custom(isValidLogLevel).withMessage('Should have a valid level'),
   query('endDate')
     .optional()
-    .custom(isDateValid).withMessage('Should have a valid end date'),
+    .custom(isDateValid).withMessage('Should have an end date that conforms to ISO 8601'),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking getLogsValidator parameters.', { parameters: req.query })
@@ -26,10 +26,10 @@ const getLogsValidator = [
 
 const getAuditLogsValidator = [
   query('startDate')
-    .custom(isDateValid).withMessage('Should have a valid start date'),
+    .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'),
   query('endDate')
     .optional()
-    .custom(isDateValid).withMessage('Should have a valid end date'),
+    .custom(isDateValid).withMessage('Should have a end date that conforms to ISO 8601'),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking getAuditLogsValidator parameters.', { parameters: req.query })