Skip to content

Commit

Permalink
fix: filter option sets
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimSM committed Oct 12, 2023
1 parent ad1ae4f commit 8dc1e4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Capture",
"homepage": ".",
"version": "36.2.0",
"cacheVersion": "2",
"cacheVersion": "3",
"private": false,
"dependencies": {
"@dhis2/app-runtime": "^2.6.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ const getCacheOptionSets = (optionSets: Array<ApiOptionSet>, optionGroupsByOptio
version: optionSet.version,
valueType: optionSet.valueType,
translations: optionSet.translations,
options: optionSet.options && [...optionSet.options.values()].map(option => ({
id: option.id,
displayName: option.displayName,
code: option.code,
style: option.style,
translations: option.translations,
})),
options: optionSet.options && [...optionSet.options.values()]
.filter(option => option && option.id)
.map(option => ({
id: option.id,
displayName: option.displayName,
code: option.code,
style: option.style,
translations: option.translations,
})),
optionGroups: optionGroupsByOptionSet[optionSet.id] && optionGroupsByOptionSet[optionSet.id].map(optionGroup => ({
id: optionGroup.id,
displayName: optionGroup.displayName,
Expand Down

0 comments on commit 8dc1e4d

Please sign in to comment.