X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fuser-notifications.ts;h=02ea3bbc24635d900abd1f5d4fe7a058446e0d54;hb=43d0ea7f4b88d52097172cc0c1831edd7e492503;hp=4fb5d922d61413097155f2bb1196d1b4778e357c;hpb=cef534ed53e4518fe0acf581bfe880788d42fc36;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/user-notifications.ts b/server/helpers/custom-validators/user-notifications.ts index 4fb5d922d..02ea3bbc2 100644 --- a/server/helpers/custom-validators/user-notifications.ts +++ b/server/helpers/custom-validators/user-notifications.ts @@ -9,8 +9,12 @@ function isUserNotificationTypeValid (value: any) { function isUserNotificationSettingValid (value: any) { return exists(value) && - validator.isInt('' + value) && - UserNotificationSettingValue[ value ] !== undefined + validator.isInt('' + value) && ( + value === UserNotificationSettingValue.NONE || + value === UserNotificationSettingValue.WEB || + value === UserNotificationSettingValue.EMAIL || + value === (UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL) + ) } export {