]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/user-notifications.ts
Add Podcast RSS feeds (#5487)
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / user-notifications.ts
index 4a7577d32ec6ad5bd25a103b22b3112be26fa779..8d70dcdd29a83ec3b2e617aab4e0ee55cba410bf 100644 (file)
@@ -2,7 +2,6 @@ import express from 'express'
 import { body, query } from 'express-validator'
 import { isNotEmptyIntArray, toBooleanOrNull } from '../../helpers/custom-validators/misc'
 import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
-import { logger } from '../../helpers/logger'
 import { areValidationErrors } from './shared'
 
 const listUserNotificationsValidator = [
@@ -12,8 +11,6 @@ const listUserNotificationsValidator = [
     .isBoolean().withMessage('Should have a valid unread boolean'),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
-    logger.debug('Checking listUserNotificationsValidator parameters', { parameters: req.query })
-
     if (areValidationErrors(req, res)) return
 
     return next()
@@ -22,33 +19,31 @@ 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 })
-
     if (areValidationErrors(req, res)) return
 
     return next()
@@ -58,11 +53,9 @@ 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 })
-
     if (areValidationErrors(req, res)) return
 
     return next()