.custom(isSignatureTypeValid).withMessage('Should have a valid signature type'),
body('signature.created')
.optional()
- .custom(isDateValid).withMessage('Should have a valid signature created date'),
+ .custom(isDateValid).withMessage('Should have a signature created date that conforms to ISO 8601'),
body('signature.creator')
.optional()
.custom(isSignatureCreatorValid).withMessage('Should have a valid signature creator'),
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 })
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 })
const videosSearchValidator = [
query('search').optional().not().isEmpty().withMessage('Should have a valid search'),
- query('startDate').optional().custom(isDateValid).withMessage('Should have a valid start date'),
- query('endDate').optional().custom(isDateValid).withMessage('Should have a valid end date'),
-
- query('originallyPublishedStartDate').optional().custom(isDateValid).withMessage('Should have a valid published start date'),
- query('originallyPublishedEndDate').optional().custom(isDateValid).withMessage('Should have a valid published end date'),
+ query('startDate')
+ .optional()
+ .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'),
+ query('endDate')
+ .optional()
+ .custom(isDateValid).withMessage('Should have a end date that conforms to ISO 8601'),
+
+ query('originallyPublishedStartDate')
+ .optional()
+ .custom(isDateValid).withMessage('Should have a published start date that conforms to ISO 8601'),
+ query('originallyPublishedEndDate')
+ .optional()
+ .custom(isDateValid).withMessage('Should have a published end date that conforms to ISO 8601'),
query('durationMin').optional().isInt().withMessage('Should have a valid min duration'),
query('durationMax').optional().isInt().withMessage('Should have a valid max duration'),
const userHistoryRemoveValidator = [
body('beforeDate')
.optional()
- .custom(isDateValid).withMessage('Should have a valid before date'),
+ .custom(isDateValid).withMessage('Should have a before date that conforms to ISO 8601'),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking userHistoryRemoveValidator parameters', { parameters: req.body })
.customSanitizer(toValueOrNull),
body('scheduleUpdate.updateAt')
.optional()
- .custom(isDateValid).withMessage('Should have a valid schedule update date'),
+ .custom(isDateValid).withMessage('Should have a schedule update date that conforms to ISO 8601'),
body('scheduleUpdate.privacy')
.optional()
.customSanitizer(toIntOrNull)