diff --git a/sites/public/src/pages/applications/contact/address.tsx b/sites/public/src/pages/applications/contact/address.tsx index 57fd262b18..b60d0f8a41 100644 --- a/sites/public/src/pages/applications/contact/address.tsx +++ b/sites/public/src/pages/applications/contact/address.tsx @@ -344,7 +344,7 @@ const ApplicationAddress = () => { name="applicant.applicantAddress.state" label={t("application.contact.state")} validation={{ required: true, maxLength: 64 }} - error={errors.applicant?.address?.state} + error={errors.applicant?.applicantAddress?.state} errorMessage={ errors.applicant?.applicantAddress?.state?.type === "maxLength" ? t("errors.maxLength") @@ -368,7 +368,7 @@ const ApplicationAddress = () => { ? t("errors.maxLength") : t("errors.zipCodeError") } - error={errors.applicant?.address?.zipCode} + error={errors.applicant?.applicantAddress?.zipCode} register={register} dataTestId={"app-primary-address-zip"} /> @@ -404,9 +404,9 @@ const ApplicationAddress = () => { defaultValue={application.applicationsMailingAddress.street} label={t("application.contact.streetAddress")} validation={{ required: true, maxLength: 64 }} - error={errors.mailingAddress?.street} + error={errors.applicationsMailingAddress?.street} errorMessage={ - errors.mailingAddress?.street?.type === "maxLength" + errors.applicationsMailingAddress?.street?.type === "maxLength" ? t("errors.maxLength") : t("errors.streetError") } @@ -422,7 +422,7 @@ const ApplicationAddress = () => { register={register} dataTestId={"app-primary-mailing-address-street2"} validation={{ maxLength: 64 }} - error={errors.mailingAddress?.street2} + error={errors.applicationsMailingAddress?.street2} errorMessage={t("errors.maxLength")} /> @@ -433,9 +433,9 @@ const ApplicationAddress = () => { label={t("application.contact.city")} defaultValue={application.applicationsMailingAddress.city} validation={{ required: true, maxLength: 64 }} - error={errors.mailingAddress?.city} + error={errors.applicationsMailingAddress?.city} errorMessage={ - errors.mailingAddress?.city?.type === "maxLength" + errors.applicationsMailingAddress?.city?.type === "maxLength" ? t("errors.maxLength") : t("errors.cityError") } @@ -450,11 +450,11 @@ const ApplicationAddress = () => { defaultValue={application.applicationsMailingAddress.state} validation={{ required: true, maxLength: 64 }} errorMessage={ - errors.mailingAddress?.state?.type === "maxLength" + errors.applicationsMailingAddress?.state?.type === "maxLength" ? t("errors.maxLength") : t("errors.stateError") } - error={errors.mailingAddress?.state} + error={errors.applicationsMailingAddress?.state} register={register} controlClassName="control" options={stateKeys} @@ -469,9 +469,9 @@ const ApplicationAddress = () => { label={t("application.contact.zip")} defaultValue={application.applicationsMailingAddress.zipCode} validation={{ required: true, maxLength: 64 }} - error={errors.mailingAddress?.zipCode} + error={errors.applicationsMailingAddress?.zipCode} errorMessage={ - errors.mailingAddress?.zipCode?.type === "maxLength" + errors.applicationsMailingAddress?.zipCode?.type === "maxLength" ? t("errors.maxLength") : t("errors.zipCodeError") } diff --git a/sites/public/src/pages/applications/household/member.tsx b/sites/public/src/pages/applications/household/member.tsx index 0d88a29d53..bf2ef272e2 100644 --- a/sites/public/src/pages/applications/household/member.tsx +++ b/sites/public/src/pages/applications/household/member.tsx @@ -290,11 +290,11 @@ const ApplicationMember = () => { defaultValue={member.householdMemberAddress.street} validation={{ required: true, maxLength: 64 }} errorMessage={ - errors.address?.street?.type === "maxLength" + errors.householdMemberAddress?.street?.type === "maxLength" ? t("errors.maxLength") : t("errors.streetError") } - error={errors.address?.street} + error={errors.householdMemberAddress?.street} register={register} dataTestId={"app-household-member-address-street"} label={t("application.contact.streetAddress")} @@ -305,7 +305,7 @@ const ApplicationMember = () => { name="householdMemberAddress.street2" label={t("application.contact.apt")} defaultValue={member.householdMemberAddress.street2} - error={errors.address?.street2} + error={errors.householdMemberAddress?.street2} validation={{ maxLength: 64 }} errorMessage={t("errors.maxLength")} register={register} @@ -320,11 +320,11 @@ const ApplicationMember = () => { defaultValue={member.householdMemberAddress.city} validation={{ required: true, maxLength: 64 }} errorMessage={ - errors.address?.city?.type === "maxLength" + errors.householdMemberAddress?.city?.type === "maxLength" ? t("errors.maxLength") : t("errors.cityError") } - error={errors.address?.city} + error={errors.householdMemberAddress?.city} register={register} dataTestId={"app-household-member-address-city"} /> @@ -335,9 +335,9 @@ const ApplicationMember = () => { label={t("application.contact.state")} defaultValue={member.householdMemberAddress.state} validation={{ required: true, maxLength: 64 }} - error={errors.address?.state} + error={errors.householdMemberAddress?.state} errorMessage={ - errors.address?.state?.type === "maxLength" + errors.householdMemberAddress?.state?.type === "maxLength" ? t("errors.maxLength") : t("errors.stateError") } @@ -355,9 +355,9 @@ const ApplicationMember = () => { label={t("application.contact.zip")} defaultValue={member.householdMemberAddress.zipCode} validation={{ required: true, maxLength: 64 }} - error={errors.address?.zipCode} + error={errors.householdMemberAddress?.zipCode} errorMessage={ - errors.address?.zipCode?.type === "maxLength" + errors.address?.householdMemberAddress?.type === "maxLength" ? t("errors.maxLength") : t("errors.zipCodeError") } @@ -400,9 +400,9 @@ const ApplicationMember = () => { label={t("application.contact.streetAddress")} defaultValue={member.householdMemberWorkAddress.street} validation={{ required: true, maxLength: 64 }} - error={errors.workAddress?.street} + error={errors.householdMemberWorkAddress?.street} errorMessage={ - errors.workAddress?.street?.type === "maxLength" + errors.householdMemberWorkAddress?.street?.type === "maxLength" ? t("errors.maxLength") : t("errors.streetError") } @@ -415,7 +415,7 @@ const ApplicationMember = () => { name="householdMemberWorkAddress.street2" label={t("application.contact.apt")} defaultValue={member.householdMemberWorkAddress.street2} - error={errors.workAddress?.street2} + error={errors.householdMemberWorkAddress?.street2} errorMessage={t("errors.maxLength")} validation={{ maxLength: 64 }} register={register} @@ -429,9 +429,9 @@ const ApplicationMember = () => { label={t("application.contact.city")} defaultValue={member.householdMemberWorkAddress.city} validation={{ required: true, maxLength: 64 }} - error={errors.workAddress?.city} + error={errors.householdMemberWorkAddress?.city} errorMessage={ - errors.workAddress?.city?.type === "maxLength" + errors.householdMemberWorkAddress?.city?.type === "maxLength" ? t("errors.maxLength") : t("errors.cityError") } @@ -445,9 +445,9 @@ const ApplicationMember = () => { label={t("application.contact.state")} defaultValue={member.householdMemberWorkAddress.state} validation={{ required: true, maxLength: 64 }} - error={errors.workAddress?.state} + error={errors.householdMemberWorkAddress?.state} errorMessage={ - errors.workAddress?.state?.type === "maxLength" + errors.householdMemberWorkAddress?.state?.type === "maxLength" ? t("errors.maxLength") : t("errors.stateError") } @@ -465,9 +465,9 @@ const ApplicationMember = () => { label={t("application.contact.zip")} defaultValue={member.householdMemberWorkAddress.zipCode} validation={{ required: true, maxLength: 64 }} - error={errors.workAddress?.zipCode} + error={errors.householdMemberWorkAddress?.zipCode} errorMessage={ - errors.workAddress?.zipCode?.type === "maxLength" + errors.householdMemberWorkAddress?.zipCode?.type === "maxLength" ? t("errors.maxLength") : t("errors.zipCodeError") }