X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fuser-notifications.ts;h=8a33b895bc0508ea3cb7953d38360e50f8981516;hb=3b0bd70aa05ab82fa30fe67ed4899d44652c703a;hp=02ea3bbc24635d900abd1f5d4fe7a058446e0d54;hpb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/user-notifications.ts b/server/helpers/custom-validators/user-notifications.ts index 02ea3bbc2..8a33b895b 100644 --- a/server/helpers/custom-validators/user-notifications.ts +++ b/server/helpers/custom-validators/user-notifications.ts @@ -1,5 +1,5 @@ import { exists } from './misc' -import * as validator from 'validator' +import validator from 'validator' import { UserNotificationType } from '../../../shared/models/users' import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' @@ -9,7 +9,8 @@ function isUserNotificationTypeValid (value: any) { function isUserNotificationSettingValid (value: any) { return exists(value) && - validator.isInt('' + value) && ( + validator.isInt('' + value) && + ( value === UserNotificationSettingValue.NONE || value === UserNotificationSettingValue.WEB || value === UserNotificationSettingValue.EMAIL ||