fix(validators): add Polish characters support for first/last name validation
- Add ąćęłńóśźżĄĆĘŁŃÓŚŹŻ to regex pattern - Fixes registration rejecting Polish characters in names
This commit is contained in:
@@ -60,14 +60,14 @@ const registerValidation = [
|
||||
.trim()
|
||||
.isLength({ max: 100 })
|
||||
.withMessage('First name must be less than 100 characters')
|
||||
.matches(/^[a-zA-ZÀ-ÿ\s'-]+$/)
|
||||
.matches(/^[a-zA-ZÀ-ÿąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]+$/)
|
||||
.withMessage('First name contains invalid characters'),
|
||||
body('lastName')
|
||||
.optional()
|
||||
.trim()
|
||||
.isLength({ max: 100 })
|
||||
.withMessage('Last name must be less than 100 characters')
|
||||
.matches(/^[a-zA-ZÀ-ÿ\s'-]+$/)
|
||||
.matches(/^[a-zA-ZÀ-ÿąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]+$/)
|
||||
.withMessage('Last name contains invalid characters'),
|
||||
body('wsdcId')
|
||||
.optional({ nullable: true, checkFalsy: true })
|
||||
|
||||
Reference in New Issue
Block a user