aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/user-notifications.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/user-notifications.ts')
-rw-r--r--server/middlewares/validators/user-notifications.ts5
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'
4import { logger } from '../../helpers/logger' 4import { logger } from '../../helpers/logger'
5import { areValidationErrors } from './utils' 5import { areValidationErrors } from './utils'
6import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' 6import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
7import { isIntArray } from '../../helpers/custom-validators/misc' 7import { isNotEmptyIntArray } from '../../helpers/custom-validators/misc'
8 8
9const listUserNotificationsValidator = [ 9const listUserNotificationsValidator = [
10 query('unread') 10 query('unread')
@@ -42,7 +42,8 @@ const updateNotificationSettingsValidator = [
42 42
43const markAsReadUserNotificationsValidator = [ 43const 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 })