From 4e9a541cdb133e5f237674be45339ddac41bed99 Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Thu, 13 Jan 2022 20:13:32 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D0=BD=D0=B0=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/validationRules.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/validationRules.ts b/src/utils/validationRules.ts index 0427f76..5c39be4 100644 --- a/src/utils/validationRules.ts +++ b/src/utils/validationRules.ts @@ -9,12 +9,14 @@ const _min1: Rule = { export const min1: Rule[] = [_min1] export const createLoginRules: Rule[] = [_min1, { - pattern: /^[A-Za-zА-Яа-я][А-Яа-я\w.-]+$/, - whitespace: true, + pattern: /^[A-Za-zА-Яа-я\s][А-Яа-я\w.-\s]+$/, message: 'Логин должен начинаться с русской или латинской буквы, содержать только (А-яA-z0-9_-.)!' +}, { + pattern: /^[^\s]+$/, + message: 'Логин не должен содержать пробельных символов', }] -export const loginRules: Rule[] = [{ +export const loginRules: Rule[] = [...createLoginRules, { required: true, message: 'Пожалуйста, введите имя пользователя' }]