Explorar o código

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

Yuki Takei %!s(int64=5) %!d(string=hai) anos
pai
achega
1ecdd9d2a2
Modificáronse 2 ficheiros con 3 adicións e 2 borrados
  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(),
   ],
 };