Skip to content

Commit

Permalink
Merge pull request #197 from praveenKDass/release-5.1.0
Browse files Browse the repository at this point in the history
prod issue hot fixes
  • Loading branch information
aks30 authored Oct 3, 2024
2 parents 0a34eda + 42e0572 commit bdbb4a0
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 bdbb4a0

Please sign in to comment.