fix build
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-29 12:38:31 +03:30
parent b92faa81a9
commit 6bff75109a
2 changed files with 7 additions and 2 deletions
@@ -12,11 +12,15 @@ const PaymentMethodCardsSection: FC<PaymentMethodCardsSectionProps> = ({ formik
const cards = formik.values.cards ?? []
const cardsError = formik.touched.cards && typeof formik.errors.cards === 'string' ? formik.errors.cards : ''
const cardErrors = Array.isArray(formik.errors.cards) ? formik.errors.cards : []
const touchedCards = Array.isArray(formik.touched.cards) ? formik.touched.cards : []
const getFieldError = (index: number, field: 'cardNumber' | 'owner') => {
const fieldErrors = cardErrors[index]
const touchedCard = touchedCards[index]
if (
!formik.touched.cards?.[index]?.[field] ||
!touchedCard ||
typeof touchedCard !== 'object' ||
!touchedCard[field] ||
!fieldErrors ||
typeof fieldErrors !== 'object' ||
!(field in fieldErrors)
@@ -12,9 +12,10 @@ const PhonesSection: FC<PhonesSectionProps> = ({ formik }) => {
const phones = formik.values.phones ?? []
const phonesError = formik.touched.phones && typeof formik.errors.phones === 'string' ? formik.errors.phones : ''
const phoneErrors = Array.isArray(formik.errors.phones) ? formik.errors.phones : []
const touchedPhones = Array.isArray(formik.touched.phones) ? formik.touched.phones : []
const getFieldError = (index: number) => {
if (!formik.touched.phones?.[index] || !phoneErrors[index]) {
if (!touchedPhones[index] || !phoneErrors[index]) {
return ''
}
return String(phoneErrors[index])