From ed56ad1193bb5bb0a81fb843a11eb90d3fed9861 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Apr 2018 10:03:40 +0200 Subject: Add ability to update the user display name/description --- server/middlewares/validators/users.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/middlewares/validators') 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' import { isAvatarFile, isUserAutoPlayVideoValid, - isUserDescriptionValid, + isUserDescriptionValid, isUserDisplayNameValid, isUserNSFWPolicyValid, isUserPasswordValid, isUserRoleValid, @@ -98,6 +98,7 @@ const usersUpdateValidator = [ ] const usersUpdateMeValidator = [ + body('displayName').optional().custom(isUserDisplayNameValid).withMessage('Should have a valid display name'), body('description').optional().custom(isUserDescriptionValid).withMessage('Should have a valid description'), body('password').optional().custom(isUserPasswordValid).withMessage('Should have a valid password'), body('email').optional().isEmail().withMessage('Should have a valid email attribute'), -- cgit v1.2.3