X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fuser-notifications.ts;h=f46303ab84982c2103d5554b6155dc487a01eabc;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=4a7577d32ec6ad5bd25a103b22b3112be26fa779;hpb=97eba003a9d0adcb0cab9190f566327b1417c7d3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/user-notifications.ts b/server/middlewares/validators/user-notifications.ts index 4a7577d32..f46303ab8 100644 --- a/server/middlewares/validators/user-notifications.ts +++ b/server/middlewares/validators/user-notifications.ts @@ -22,29 +22,29 @@ const listUserNotificationsValidator = [ const updateNotificationSettingsValidator = [ body('newVideoFromSubscription') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new video from subscription notification setting'), + .custom(isUserNotificationSettingValid), body('newCommentOnMyVideo') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new comment on my video notification setting'), + .custom(isUserNotificationSettingValid), body('abuseAsModerator') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid abuse as moderator notification setting'), + .custom(isUserNotificationSettingValid), body('videoAutoBlacklistAsModerator') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid video auto blacklist notification setting'), + .custom(isUserNotificationSettingValid), body('blacklistOnMyVideo') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new blacklist on my video notification setting'), + .custom(isUserNotificationSettingValid), body('myVideoImportFinished') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid video import finished video notification setting'), + .custom(isUserNotificationSettingValid), body('myVideoPublished') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid video published notification setting'), + .custom(isUserNotificationSettingValid), body('commentMention') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid comment mention notification setting'), + .custom(isUserNotificationSettingValid), body('newFollow') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new follow notification setting'), + .custom(isUserNotificationSettingValid), body('newUserRegistration') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new user registration notification setting'), + .custom(isUserNotificationSettingValid), body('newInstanceFollower') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new instance follower notification setting'), + .custom(isUserNotificationSettingValid), body('autoInstanceFollowing') - .custom(isUserNotificationSettingValid).withMessage('Should have a valid new instance following notification setting'), + .custom(isUserNotificationSettingValid), (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking updateNotificationSettingsValidator parameters', { parameters: req.body }) @@ -58,7 +58,7 @@ const updateNotificationSettingsValidator = [ const markAsReadUserNotificationsValidator = [ body('ids') .optional() - .custom(isNotEmptyIntArray).withMessage('Should have a valid notification ids to mark as read'), + .custom(isNotEmptyIntArray).withMessage('Should have a valid array of notification ids'), (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking markAsReadUserNotificationsValidator parameters', { parameters: req.body })