diff --git a/domains/DataCollection/FormGallery/index.js b/domains/DataCollection/FormGallery/index.js index c2606c2c4..58ea4f2e2 100644 --- a/domains/DataCollection/FormGallery/index.js +++ b/domains/DataCollection/FormGallery/index.js @@ -34,6 +34,7 @@ const FormGallery = ({ const refreshCustomForms = () => { setLoading(true); customFormsQuery(surveyingOrganization).then((forms) => { + console.log(forms) setCustomForms(forms); setLoading(false); }); diff --git a/modules/cached-resources/read.js b/modules/cached-resources/read.js index a6f37f7bb..7aa2e90f3 100644 --- a/modules/cached-resources/read.js +++ b/modules/cached-resources/read.js @@ -66,8 +66,14 @@ function customFormsQuery(surveyingOrganization) { return customMultiParamQueryService(5000, 'FormSpecificationsV2', parseParams).then(async (forms) => { if (forms !== null && forms !== undefined && forms !== '') { - await storeData(forms, 'customForms'); - return JSON.parse(JSON.stringify(forms)); + let activeForms = [] + JSON.parse(JSON.stringify(forms)).forEach((form) => { + if(form.active !== 'false'){ + activeForms = activeForms.concat([form]) + } + }) + await storeData(activeForms, 'customForms'); + return activeForms; } return getData('customForms').then((customForms) => customForms); }, (error) => {