diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-08 11:26:41 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-01-09 11:15:15 +0100 |
commit | 2f1548fda32c3ba9e53913270394eedfacd55986 (patch) | |
tree | afee28df36a9e00f921603d9091e5d08d5818159 /server/middlewares | |
parent | f7cc67b455a12ccae9b0ea16876d166720364357 (diff) | |
download | PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.gz PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.zst PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.zip |
Add notifications in the client
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/user-notifications.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/user-notifications.ts b/server/middlewares/validators/user-notifications.ts index 1c31f0a73..46486e081 100644 --- a/server/middlewares/validators/user-notifications.ts +++ b/server/middlewares/validators/user-notifications.ts | |||
@@ -4,7 +4,7 @@ import { body, query } from 'express-validator/check' | |||
4 | import { logger } from '../../helpers/logger' | 4 | import { logger } from '../../helpers/logger' |
5 | import { areValidationErrors } from './utils' | 5 | import { areValidationErrors } from './utils' |
6 | import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' | 6 | import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' |
7 | import { isIntArray } from '../../helpers/custom-validators/misc' | 7 | import { isNotEmptyIntArray } from '../../helpers/custom-validators/misc' |
8 | 8 | ||
9 | const listUserNotificationsValidator = [ | 9 | const listUserNotificationsValidator = [ |
10 | query('unread') | 10 | query('unread') |
@@ -42,7 +42,8 @@ const updateNotificationSettingsValidator = [ | |||
42 | 42 | ||
43 | const markAsReadUserNotificationsValidator = [ | 43 | const markAsReadUserNotificationsValidator = [ |
44 | body('ids') | 44 | body('ids') |
45 | .custom(isIntArray).withMessage('Should have a valid notification ids to mark as read'), | 45 | .optional() |
46 | .custom(isNotEmptyIntArray).withMessage('Should have a valid notification ids to mark as read'), | ||
46 | 47 | ||
47 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 48 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
48 | logger.debug('Checking markAsReadUserNotificationsValidator parameters', { parameters: req.body }) | 49 | logger.debug('Checking markAsReadUserNotificationsValidator parameters', { parameters: req.body }) |