]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/user-notifications.ts
Cleanup useless express validator messages
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / user-notifications.ts
index 4a7577d32ec6ad5bd25a103b22b3112be26fa779..f46303ab84982c2103d5554b6155dc487a01eabc 100644 (file)
@@ -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 })