diff --git a/fixtures/static/js/json-schema-editor.mjs b/fixtures/static/js/json-schema-editor.mjs index 341d3dbc..edb2485f 100644 --- a/fixtures/static/js/json-schema-editor.mjs +++ b/fixtures/static/js/json-schema-editor.mjs @@ -100,6 +100,7 @@ export class JsonSchemaEditor { const value = JSON.parse(this.$module.value); const data = jsonSchema.getTemplate(value); + this.nullEmptyDates(data); this.$module.value = JSON.stringify(data); this.$formContainer.innerHTML = ""; @@ -112,6 +113,19 @@ export class JsonSchemaEditor { }); } + nullEmptyDates(data) { + [ + "/signedAt", + "/witnessedByCertificateProviderAt", + "/witnessedByIndependentWitnessAt", + "/certificateProviderNotRelatedConfirmedAt", + ].forEach((datePointer) => { + if (jsonGet(data, datePointer) === "") { + jsonSet(data, datePointer, null); + } + }); + } + addToArray(pointer) { const value = JSON.parse(this.$module.value); const arr = jsonGet(value, pointer) ?? [];