Skip to content

Commit

Permalink
fix: do not pass a boolean for icons when saving
Browse files Browse the repository at this point in the history
If the option is not set, and thus its value is the same as the default
(false) remove it from the current object to avoid sending a boolean
value that the backend does not expect.
This was causing any save to return 500.
  • Loading branch information
edoardo committed Mar 27, 2023
1 parent 276618e commit 4a88294
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/current.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export const getOptionsFromUi = (ui) => {
// icons is stored as array of objects { type: DATA_ITEM }
if (optionsFromUi.icons !== options.icons.defaultValue) {
optionsFromUi.icons = [{ type: 'DATA_ITEM' }]
} else {
// if options is not enabled, do not pass the "internal" boolean value
delete optionsFromUi.icons
}

// nested options under reportingParams
Expand Down

0 comments on commit 4a88294

Please sign in to comment.