From e157406787ae3dcce7e9f485878096d8ff784c80 Mon Sep 17 00:00:00 2001 From: fakz9 Date: Tue, 30 Apr 2024 02:44:04 +0300 Subject: [PATCH] feat: client details --- .../modals/ClientFormModal/ClientFormModal.tsx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/pages/ClientsPage/modals/ClientFormModal/ClientFormModal.tsx b/src/pages/ClientsPage/modals/ClientFormModal/ClientFormModal.tsx index dcddb43..cdc35f2 100644 --- a/src/pages/ClientsPage/modals/ClientFormModal/ClientFormModal.tsx +++ b/src/pages/ClientsPage/modals/ClientFormModal/ClientFormModal.tsx @@ -2,7 +2,6 @@ import {ContextModalProps} from "@mantine/modals"; import {Fieldset, TextInput} from "@mantine/core"; import {useForm} from "@mantine/form"; import {ClientSchema} from "../../../../client"; -import {getDigitsCount} from "../../../../shared/lib/utils.ts"; import BaseFormModal, {CreateEditFormProps} from "../BaseFormModal/BaseFormModal.tsx"; @@ -38,12 +37,12 @@ const ClientFormModal = ({ initialValues: initialValues, validate: { name: (name: string) => name.trim() !== '' ? null : "Необходимо ввести название клиента", - details: { - telegram: (address: string | undefined | null) => (address && address.trim() !== '') ? null : "Необходимо ввести телеграм", - phoneNumber: (phoneNumber: string | undefined | null) => (phoneNumber && phoneNumber.trim() !== '') ? null : "Необходимо ввести номер телефона", - email: (email: string | undefined | null) => (email && email.trim() !== '') ? null : "Необходимо ввести почту", - inn: (inn: string | undefined | null) => (inn && getDigitsCount(parseInt(inn)) >= 10) ? null : "ИНН должен содержать не менее 10 цифр", - } + // details: { + // telegram: (address: string | undefined | null) => (address && address.trim() !== '') ? null : "Необходимо ввести телеграм", + // phoneNumber: (phoneNumber: string | undefined | null) => (phoneNumber && phoneNumber.trim() !== '') ? null : "Необходимо ввести номер телефона", + // email: (email: string | undefined | null) => (email && email.trim() !== '') ? null : "Необходимо ввести почту", + // inn: (inn: string | undefined | null) => (inn && getDigitsCount(parseInt(inn)) >= 10) ? null : "ИНН должен содержать не менее 10 цифр", + // } } }) @@ -70,25 +69,21 @@ const ClientFormModal = ({