Skip to content

Commit

Permalink
fix: reduce bulk state data
Browse files Browse the repository at this point in the history
Signed-off-by: Hunter Achieng <[email protected]>
  • Loading branch information
hunterachieng committed May 13, 2024
2 parents 7155659 + d28efa8 commit 2b7d4a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions form-sharing/1-getNewKoboForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ getForms({}, state => {
};

state.koboForms = state.data.results.filter(form => checkForKeyWords(form.name));
// console.log('data::', state.data);
// console.log('results::', state.data.results);
state.data={};
state.references = [];
return state;
});
});

3 changes: 2 additions & 1 deletion form-sharing/2-getSheetsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fn((state) => {
state.filteredKoboFormsData = koboForms.filter(
(form) => !sheetsUids.includes(form.uid)
);

state.data = {};
state.references = [];
return state;
});
6 changes: 3 additions & 3 deletions form-sharing/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"adaptor": "kobotoolbox",
"expression": "1-getNewKoboForms.js",
"next": {
"getSheetsList": "!state.error && state.data.length !== 0"
"getSheetsList": "!state.errors"
}
},
{
Expand All @@ -19,7 +19,7 @@
"expression": "2-getSheetsList.js",
"adaptor": "googlesheets",
"next": {
"updateSheetsList": "!state.error && state.data.length !== 0"
"updateSheetsList": "!state.errors"
}
},
{
Expand All @@ -28,7 +28,7 @@
"expression": "3-updateSheetsList.js",
"adaptor": "googlesheets",
"next": {
"upsertAsanaTask": "!state.error && state.sheetsData.length !== 0"
"upsertAsanaTask": "!state.errors"
}
},
{
Expand Down

0 comments on commit 2b7d4a8

Please sign in to comment.