From 1888584d97196c12903166f63cb87439c5fb2e71 Mon Sep 17 00:00:00 2001 From: R Ranathunga Date: Tue, 18 Jun 2024 09:43:22 -0700 Subject: [PATCH] fix: benefit schema validation issue --- app/components/Form/ApplicationForm.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/components/Form/ApplicationForm.tsx b/app/components/Form/ApplicationForm.tsx index 2b53ef4a36..e8ff92a971 100644 --- a/app/components/Form/ApplicationForm.tsx +++ b/app/components/Form/ApplicationForm.tsx @@ -250,18 +250,13 @@ const ApplicationForm: React.FC = ({ ...uiSchema, 'ui:order': filteredUiSchemaOrder, }; - // if it is intake 4, use v3 of UIschema - } else if ( - latestIntakeNumber === 4 && - (ccbcIntakeNumber === null || ccbcIntakeNumber === 4) - ) { - finalUiSchema = { - ...uiSchemaV3, - 'ui:order': filteredUiSchemaOrder, - }; } else { + // if it is intake 4, use v3 of UIschema + const isIntake4 = + latestIntakeNumber === 4 && + (ccbcIntakeNumber === null || ccbcIntakeNumber === 4); finalUiSchema = { - ...uiSchema, + ...(isIntake4 ? uiSchemaV3 : uiSchema), benefits: { ...applicantBenefits, },