Skip to content

Commit 4a88294

Browse files
committed
fix: do not pass a boolean for icons when saving
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.
1 parent 276618e commit 4a88294

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/modules/current.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export const getOptionsFromUi = (ui) => {
8282
// icons is stored as array of objects { type: DATA_ITEM }
8383
if (optionsFromUi.icons !== options.icons.defaultValue) {
8484
optionsFromUi.icons = [{ type: 'DATA_ITEM' }]
85+
} else {
86+
// if options is not enabled, do not pass the "internal" boolean value
87+
delete optionsFromUi.icons
8588
}
8689

8790
// nested options under reportingParams

0 commit comments

Comments
 (0)