diff options
Diffstat (limited to 'server/helpers/custom-validators/users.ts')
-rw-r--r-- | server/helpers/custom-validators/users.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts index c0acb8218..b59b766de 100644 --- a/server/helpers/custom-validators/users.ts +++ b/server/helpers/custom-validators/users.ts | |||
@@ -22,6 +22,10 @@ function isUserUsernameValid (value: string) { | |||
22 | return exists(value) && validator.matches(value, new RegExp(`^[a-z0-9._]{${min},${max}}$`)) | 22 | return exists(value) && validator.matches(value, new RegExp(`^[a-z0-9._]{${min},${max}}$`)) |
23 | } | 23 | } |
24 | 24 | ||
25 | function isUserDisplayNameValid (value: string) { | ||
26 | return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.NAME)) | ||
27 | } | ||
28 | |||
25 | function isUserDescriptionValid (value: string) { | 29 | function isUserDescriptionValid (value: string) { |
26 | return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.DESCRIPTION)) | 30 | return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.DESCRIPTION)) |
27 | } | 31 | } |
@@ -60,6 +64,7 @@ export { | |||
60 | isUserUsernameValid, | 64 | isUserUsernameValid, |
61 | isUserNSFWPolicyValid, | 65 | isUserNSFWPolicyValid, |
62 | isUserAutoPlayVideoValid, | 66 | isUserAutoPlayVideoValid, |
67 | isUserDisplayNameValid, | ||
63 | isUserDescriptionValid, | 68 | isUserDescriptionValid, |
64 | isAvatarFile | 69 | isAvatarFile |
65 | } | 70 | } |