aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-08 11:26:41 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-01-09 11:15:15 +0100
commit2f1548fda32c3ba9e53913270394eedfacd55986 (patch)
treeafee28df36a9e00f921603d9091e5d08d5818159 /server/middlewares/validators
parentf7cc67b455a12ccae9b0ea16876d166720364357 (diff)
downloadPeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.gz
PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.zst
PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.zip
Add notifications in the client
Diffstat (limited to 'server/middlewares/validators')
-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 })