diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/FieldListDrawer/field-panels/MyInfoPanel.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/FieldListDrawer/field-panels/MyInfoPanel.tsx index ed86c2db7c..1080a918a7 100644 --- a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/FieldListDrawer/field-panels/MyInfoPanel.tsx +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/FieldListDrawer/field-panels/MyInfoPanel.tsx @@ -244,8 +244,7 @@ export const MyInfoFieldPanel = ({ searchValue }: { searchValue: string }) => { )} - {user?.betaFlags?.children && - form?.responseMode === FormResponseMode.Email ? ( + {user?.betaFlags?.children ? ( {(provided) => ( diff --git a/src/app/modules/myinfo/myinfo.util.ts b/src/app/modules/myinfo/myinfo.util.ts index e8c15fddd8..ce847be7c2 100644 --- a/src/app/modules/myinfo/myinfo.util.ts +++ b/src/app/modules/myinfo/myinfo.util.ts @@ -521,7 +521,7 @@ export const handleMyInfoChildHashResponse = ( // Validate each answer (child) childAnswer.forEach((attrAnswer, subFieldIndex) => { const key = getMyInfoChildHashKey( - field._id as string, + field._id, subFields[subFieldIndex], childIndex, childName, diff --git a/src/app/modules/submission/submission.utils.ts b/src/app/modules/submission/submission.utils.ts index 495fc5f91d..d02d2308c5 100644 --- a/src/app/modules/submission/submission.utils.ts +++ b/src/app/modules/submission/submission.utils.ts @@ -91,7 +91,6 @@ import { MyInfoMissingLoginCookieError, } from '../myinfo/myinfo.errors' import { MyInfoKey } from '../myinfo/myinfo.types' -import { getMyInfoChildHashKey } from '../myinfo/myinfo.util' import { InvalidPaymentProductsError, PaymentNotFoundError, @@ -752,17 +751,12 @@ export const getAnswersForChild = ( return [] } return response.answerArray.flatMap((arr, childIdx) => { - // First array element is always child name - const childName = arr[0] return arr.map((answer, idx) => { const subfield = subFields[idx] return { - _id: getMyInfoChildHashKey( - response._id, - subFields[idx], - childIdx, - childName, - ), + // Recreates the individual _id of the child field based on the parent field's _id and the subfield + // e.g., childrenbirthrecords.67585515e1ced6d790a91e14.childname.0 + _id: `${MyInfoAttribute.ChildrenBirthRecords}.${response._id}.${subFields[idx]}.${childIdx}`, fieldType: response.fieldType, // qnChildIdx represents the index of the MyInfo field // childIdx represents the index of the child in this MyInfo field