aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/users.ts')
-rw-r--r--server/helpers/custom-validators/users.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts
index 8a6f6fca1..9df550fc2 100644
--- a/server/helpers/custom-validators/users.ts
+++ b/server/helpers/custom-validators/users.ts
@@ -1,4 +1,3 @@
1import { values } from 'lodash'
2import validator from 'validator' 1import validator from 'validator'
3import { UserRole } from '@shared/models' 2import { UserRole } from '@shared/models'
4import { isEmailEnabled } from '../../initializers/config' 3import { isEmailEnabled } from '../../initializers/config'
@@ -44,9 +43,9 @@ function isUserEmailVerifiedValid (value: any) {
44 return isBooleanValid(value) 43 return isBooleanValid(value)
45} 44}
46 45
47const nsfwPolicies = values(NSFW_POLICY_TYPES) 46const nsfwPolicies = new Set(Object.values(NSFW_POLICY_TYPES))
48function isUserNSFWPolicyValid (value: any) { 47function isUserNSFWPolicyValid (value: any) {
49 return exists(value) && nsfwPolicies.includes(value) 48 return exists(value) && nsfwPolicies.has(value)
50} 49}
51 50
52function isUserP2PEnabledValid (value: any) { 51function isUserP2PEnabledValid (value: any) {