diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-26 10:03:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-26 10:03:40 +0200 |
commit | ed56ad1193bb5bb0a81fb843a11eb90d3fed9861 (patch) | |
tree | 64842447b4721978c69e1d2b3a964951c789c408 /server/middlewares/validators/users.ts | |
parent | d62cf3234ccfca0223a9639782635f0fb6594f8c (diff) | |
download | PeerTube-ed56ad1193bb5bb0a81fb843a11eb90d3fed9861.tar.gz PeerTube-ed56ad1193bb5bb0a81fb843a11eb90d3fed9861.tar.zst PeerTube-ed56ad1193bb5bb0a81fb843a11eb90d3fed9861.zip |
Add ability to update the user display name/description
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 5dd8caa3f..247b704c4 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -7,7 +7,7 @@ import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' | |||
7 | import { | 7 | import { |
8 | isAvatarFile, | 8 | isAvatarFile, |
9 | isUserAutoPlayVideoValid, | 9 | isUserAutoPlayVideoValid, |
10 | isUserDescriptionValid, | 10 | isUserDescriptionValid, isUserDisplayNameValid, |
11 | isUserNSFWPolicyValid, | 11 | isUserNSFWPolicyValid, |
12 | isUserPasswordValid, | 12 | isUserPasswordValid, |
13 | isUserRoleValid, | 13 | isUserRoleValid, |
@@ -98,6 +98,7 @@ const usersUpdateValidator = [ | |||
98 | ] | 98 | ] |
99 | 99 | ||
100 | const usersUpdateMeValidator = [ | 100 | const usersUpdateMeValidator = [ |
101 | body('displayName').optional().custom(isUserDisplayNameValid).withMessage('Should have a valid display name'), | ||
101 | body('description').optional().custom(isUserDescriptionValid).withMessage('Should have a valid description'), | 102 | body('description').optional().custom(isUserDescriptionValid).withMessage('Should have a valid description'), |
102 | body('password').optional().custom(isUserPasswordValid).withMessage('Should have a valid password'), | 103 | body('password').optional().custom(isUserPasswordValid).withMessage('Should have a valid password'), |
103 | body('email').optional().isEmail().withMessage('Should have a valid email attribute'), | 104 | body('email').optional().isEmail().withMessage('Should have a valid email attribute'), |