diff --git a/generics/messageConstants/common.js b/generics/messageConstants/common.js index 6a3370bc..21316e52 100644 --- a/generics/messageConstants/common.js +++ b/generics/messageConstants/common.js @@ -62,5 +62,6 @@ module.exports = { CACHE_TTL : 43200 , GET_METHOD : "GET", SUBENTITY :"subEntityTypesOf_", - STATE: "state" + STATE: "state", + PERSONA: "persona" } \ No newline at end of file diff --git a/generics/services/form.js b/generics/services/form.js index 41df7869..c24fe9df 100644 --- a/generics/services/form.js +++ b/generics/services/form.js @@ -30,8 +30,10 @@ const configForStateLocation = function ( stateLocationCode, entityKey ) { }) } - let subEntityData = subEntitiesDetails.data.form.data.fields[1].children.teacher; - + let subEntityData = subEntitiesDetails.data.form.data.fields.filter((fieldInstance)=>{ + return fieldInstance.code == messageConstants.common.PERSONA + })[0].children.administrator; + //Entity type is stored in a key called code let subEntities = subEntityData.map( subEntity => { return subEntity.code;