From 305afd7f2c1911aebe3499a5a8790a139b53b7af Mon Sep 17 00:00:00 2001 From: Niko Pitkonen Date: Thu, 21 Sep 2023 12:33:44 +0300 Subject: [PATCH] HAI-1586 Add missing index, add should validate, cleanup --- src/domain/hanke/edit/HankeFormYhteystiedot.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/domain/hanke/edit/HankeFormYhteystiedot.tsx b/src/domain/hanke/edit/HankeFormYhteystiedot.tsx index 7fe46c7b0..de65ac45d 100644 --- a/src/domain/hanke/edit/HankeFormYhteystiedot.tsx +++ b/src/domain/hanke/edit/HankeFormYhteystiedot.tsx @@ -126,7 +126,9 @@ const ContactField: React.FC<{ useEffect(() => { if (inputDisabled) { - setValue(`${contactType}.0.ytunnus`, null); + setValue(`${contactType}.${index}.ytunnus`, null, { + shouldValidate: true, + }); } }, [inputDisabled]); @@ -261,7 +263,6 @@ const HankeFormYhteystiedot: React.FC = () => { {CONTACT_FIELDS.map((contactField) => { const fieldName = `${FORMFIELD.RAKENNUTTAJAT}.${index}.${contactField}`; - index; return (