Skip to content

Commit

Permalink
prod issue hot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenKDass committed Oct 3, 2024
1 parent 0a34eda commit 42e0572
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:20

WORKDIR /opt/core

Expand Down
12 changes: 9 additions & 3 deletions generics/services/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ const configForStateLocation = function ( stateLocationCode, entityKey ) {
let subEntityData = subEntitiesDetails.data.form.data.fields.filter((fieldInstance)=>{
return fieldInstance.code == constants.common.PERSONA
})[0].children.administrator;

let allowedLocationFields = ["state", "district", "block", "cluster", "school"];
//Entity type is stored in a key called code
let subEntities = subEntityData.map( subEntity => {
return subEntity.code;
})
let subEntities = subEntityData.filter( subEntity => {
if(allowedLocationFields.includes(subEntity.code)){
return true;
}else {
return false;
}
}).map(subEntity => subEntity.code)
//set cache data for given state
let setCache = cache.setValue(entityKey, subEntities, constants.common.CACHE_TTL);
return resolve(subEntities);
Expand Down

0 comments on commit 42e0572

Please sign in to comment.