fix(ui): cast empty strings to null

This commit is contained in:
Torsten Dittmann
2021-10-29 17:50:59 +02:00
parent 535f433817
commit 6da10ca4ae
+4 -1
View File
@@ -24,6 +24,9 @@
break;
case 'string':
value = value.toString();
if (value.length === 0) {
value = null;
}
break;
case 'json':
value = (value) ? JSON.parse(value) : [];
@@ -111,7 +114,7 @@
json[name] = element.value;
}
}
json[name] = cast(json[name], castTo); // Apply casting
}
}