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()
|
.trim()
|
||||||
.isLength({ max: 100 })
|
.isLength({ max: 100 })
|
||||||
.withMessage('First name must be less than 100 characters')
|
.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'),
|
.withMessage('First name contains invalid characters'),
|
||||||
body('lastName')
|
body('lastName')
|
||||||
.optional()
|
.optional()
|
||||||
.trim()
|
.trim()
|
||||||
.isLength({ max: 100 })
|
.isLength({ max: 100 })
|
||||||
.withMessage('Last name must be less than 100 characters')
|
.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'),
|
.withMessage('Last name contains invalid characters'),
|
||||||
body('wsdcId')
|
body('wsdcId')
|
||||||
.optional({ nullable: true, checkFalsy: true })
|
.optional({ nullable: true, checkFalsy: true })
|
||||||
|
|||||||
Reference in New Issue
Block a user