-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hunter Achieng <[email protected]>
- Loading branch information
1 parent
94be915
commit 8235b1a
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); | ||
|