From 1a7bad29d165eb4499f6a831488e320ea0dbd074 Mon Sep 17 00:00:00 2001 From: smanylov Date: Fri, 27 Feb 2026 11:22:00 +0700 Subject: [PATCH] add validation message while inn alredy registred --- src/app/actions/auth.ts | 2 ++ src/i18n/messages/en.json | 3 ++- src/i18n/messages/ru.json | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/actions/auth.ts b/src/app/actions/auth.ts index d3116b9..110ee45 100644 --- a/src/app/actions/auth.ts +++ b/src/app/actions/auth.ts @@ -330,6 +330,8 @@ export async function registration( } }); + } else if (typedError.message_desc === 'Company already exists') { + errors['inn'] = 'company-already-registered' } else { errors['server'] = 'unknown-error' } diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 957d754..21e051b 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -367,6 +367,7 @@ "inn-placeholder": "Enter 10 digits", "INN": "INN", "fullName-required": "Please fill in the field correctly.", - "fullName-too-short": "Name must be at least 2 characters long." + "fullName-too-short": "Name must be at least 2 characters long.", + "company-already-registered": "The company is already registered." } } \ No newline at end of file diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index 22a250a..b01ee2e 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -367,6 +367,7 @@ "inn-placeholder": "Введите 10 цифр", "INN": "ИНН", "fullName-required": "Заполните поле корректно.", - "fullName-too-short": "Имя должно содержать не менее 2 символов." + "fullName-too-short": "Имя должно содержать не менее 2 символов.", + "company-already-registered": "Компания уже зарегистрирована." } } \ No newline at end of file