From 4787151b6994cea2284ba462f44f0de6ae32fa6e Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Sat, 28 Jun 2025 12:54:28 +0400 Subject: [PATCH] fix: client empty phone number enabled --- .../cardModules/cardEditorTabs/ClientTab/ClientTab.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/cardModules/cardEditorTabs/ClientTab/ClientTab.tsx b/src/modules/cardModules/cardEditorTabs/ClientTab/ClientTab.tsx index 8706144..ee23c92 100644 --- a/src/modules/cardModules/cardEditorTabs/ClientTab/ClientTab.tsx +++ b/src/modules/cardModules/cardEditorTabs/ClientTab/ClientTab.tsx @@ -22,12 +22,14 @@ const ClientTab = () => { initialValues, validate: { details: { - phoneNumber: value => - !phone(value || "", { + phoneNumber: value => { + if (!value) return; + return !phone(value || "", { country: "", strictDetection: false, validateMobilePrefix: false, - }).isValid && "Неверно указан номер телефона", + }).isValid && "Неверно указан номер телефона"; + }, inn: (inn: string | undefined | null) => inn && !isValidInn(inn) ? "Некорректный ИНН" : null, }, }, @@ -164,4 +166,4 @@ const ClientTab = () => { ); }; -export default ClientTab; \ No newline at end of file +export default ClientTab;