aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/user-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 14:27:04 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 14:27:04 +0200
commit396f6f0140b0f76162e2378fd5a61e2f888673ed (patch)
treea5bd668bfc7dca7f311b9fc42ebb8bd01f462648 /server/middlewares/validators/user-notifications.ts
parent97eba003a9d0adcb0cab9190f566327b1417c7d3 (diff)
downloadPeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.gz
PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.zst
PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.zip
Cleanup useless express validator messages
Diffstat (limited to 'server/middlewares/validators/user-notifications.ts')
-rw-r--r--server/middlewares/validators/user-notifications.ts26
1 files changed, 13 insertions, 13 deletions
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 = [
22 22
23const updateNotificationSettingsValidator = [ 23const updateNotificationSettingsValidator = [
24 body('newVideoFromSubscription') 24 body('newVideoFromSubscription')
25 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new video from subscription notification setting'), 25 .custom(isUserNotificationSettingValid),
26 body('newCommentOnMyVideo') 26 body('newCommentOnMyVideo')
27 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new comment on my video notification setting'), 27 .custom(isUserNotificationSettingValid),
28 body('abuseAsModerator') 28 body('abuseAsModerator')
29 .custom(isUserNotificationSettingValid).withMessage('Should have a valid abuse as moderator notification setting'), 29 .custom(isUserNotificationSettingValid),
30 body('videoAutoBlacklistAsModerator') 30 body('videoAutoBlacklistAsModerator')
31 .custom(isUserNotificationSettingValid).withMessage('Should have a valid video auto blacklist notification setting'), 31 .custom(isUserNotificationSettingValid),
32 body('blacklistOnMyVideo') 32 body('blacklistOnMyVideo')
33 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new blacklist on my video notification setting'), 33 .custom(isUserNotificationSettingValid),
34 body('myVideoImportFinished') 34 body('myVideoImportFinished')
35 .custom(isUserNotificationSettingValid).withMessage('Should have a valid video import finished video notification setting'), 35 .custom(isUserNotificationSettingValid),
36 body('myVideoPublished') 36 body('myVideoPublished')
37 .custom(isUserNotificationSettingValid).withMessage('Should have a valid video published notification setting'), 37 .custom(isUserNotificationSettingValid),
38 body('commentMention') 38 body('commentMention')
39 .custom(isUserNotificationSettingValid).withMessage('Should have a valid comment mention notification setting'), 39 .custom(isUserNotificationSettingValid),
40 body('newFollow') 40 body('newFollow')
41 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new follow notification setting'), 41 .custom(isUserNotificationSettingValid),
42 body('newUserRegistration') 42 body('newUserRegistration')
43 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new user registration notification setting'), 43 .custom(isUserNotificationSettingValid),
44 body('newInstanceFollower') 44 body('newInstanceFollower')
45 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new instance follower notification setting'), 45 .custom(isUserNotificationSettingValid),
46 body('autoInstanceFollowing') 46 body('autoInstanceFollowing')
47 .custom(isUserNotificationSettingValid).withMessage('Should have a valid new instance following notification setting'), 47 .custom(isUserNotificationSettingValid),
48 48
49 (req: express.Request, res: express.Response, next: express.NextFunction) => { 49 (req: express.Request, res: express.Response, next: express.NextFunction) => {
50 logger.debug('Checking updateNotificationSettingsValidator parameters', { parameters: req.body }) 50 logger.debug('Checking updateNotificationSettingsValidator parameters', { parameters: req.body })
@@ -58,7 +58,7 @@ const updateNotificationSettingsValidator = [
58const markAsReadUserNotificationsValidator = [ 58const markAsReadUserNotificationsValidator = [
59 body('ids') 59 body('ids')
60 .optional() 60 .optional()
61 .custom(isNotEmptyIntArray).withMessage('Should have a valid notification ids to mark as read'), 61 .custom(isNotEmptyIntArray).withMessage('Should have a valid array of notification ids'),
62 62
63 (req: express.Request, res: express.Response, next: express.NextFunction) => { 63 (req: express.Request, res: express.Response, next: express.NextFunction) => {
64 logger.debug('Checking markAsReadUserNotificationsValidator parameters', { parameters: req.body }) 64 logger.debug('Checking markAsReadUserNotificationsValidator parameters', { parameters: req.body })