Skip to content

Commit

Permalink
fix: format 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 14, 2024
1 parent 94be915 commit 8235b1a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions form-sharing/1-getNewKoboForms.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
//Check Kobo account for forms with these matching keywords
getForms({}, state => {
//ALL KEYWORDS:
//ALL KEYWORDS:
//const keywords = ['price', 'prix', 'bns', 'nrgt', 'grm', 'feedback'];

//BNS KEYWORDS ONLY
const keywords = ['price', 'prix', 'bns', 'nrgt'];

const checkForKeyWords = name => {
return keywords.some(keyword => name.toLowerCase().includes(keyword));
};

state.koboForms = state.data.results.filter(form => checkForKeyWords(form.name)).filter(form => form.deployment__active);
state.data={};
state.koboForms = state.data.results
.filter(form => checkForKeyWords(form.name))
.filter(form => form.deployment__active);
state.data = {};
state.references = [];
return state;
});

0 comments on commit 8235b1a

Please sign in to comment.