diff options
Diffstat (limited to 'server/middlewares/validators')
-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 }) |