We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b17cf2e commit 40be991Copy full SHA for 40be991
web/static/config/edit.html
@@ -139,6 +139,17 @@
139
alert('Error: cannot edit defaults');
140
} else {
141
const value = editor.getValue();
142
+ function cleanEmptyArrays(json) {
143
+ if (Array.isArray(json)) {
144
+ return json.filter(item => item !== ""); // Remove empty strings from arrays
145
+ } else if (typeof json === "object" && json !== null) {
146
+ Object.keys(json).forEach(key => {
147
+ json[key] = cleanEmptyArrays(json[key]); // Recursively clean nested structures
148
+ });
149
+ }
150
+ return json;
151
152
+ cleanEmptyArrays(value);
153
console.log(value)
154
axios.post('/api/config/layers/' + layer, value)
155
.then(response => {
0 commit comments