Просмотр исходного кода

BugFix: Enable/disable Notification settings couldn't change when either of the params is undefined

Yuki Takei 5 лет назад
Родитель
Сommit
1ecdd9d2a2
2 измененных файлов с 3 добавлено и 2 удалено
  1. 1 0
      CHANGES.md
  2. 2 2
      src/server/routes/apiv3/notification-setting.js

+ 1 - 0
CHANGES.md

@@ -6,6 +6,7 @@
 * Improvement: Apply styles faster on booting client
 * Fix: Styles are not applyed on installer
 * Fix: Remove last-resort `next()`
+* Fix: Enable/disable Notification settings couldn't change when either of the params is undefined
 
 ## v4.0.6
 

+ 2 - 2
src/server/routes/apiv3/notification-setting.js

@@ -34,8 +34,8 @@ const validator = {
     }),
   ],
   notifyForPageGrant: [
-    body('isNotificationForOwnerPageEnabled').isBoolean(),
-    body('isNotificationForGroupPageEnabled').isBoolean(),
+    body('isNotificationForOwnerPageEnabled').if(value => value != null).isBoolean(),
+    body('isNotificationForGroupPageEnabled').if(value => value != null).isBoolean(),
   ],
 };