refactor: more refactoring to topics as the top-level organization

This commit is contained in:
Andy Burke 2025-09-11 14:09:28 -07:00
parent 11ecd86bb9
commit 4347d20263
18 changed files with 730 additions and 317 deletions

View file

@ -21,6 +21,18 @@ document.addEventListener("DOMContentLoaded", () => {
const form_data = new FormData(form);
for (const [key, value] of form_data.entries()) {
if (key.length === 0) {
continue;
}
if (typeof value === "string" && value.length === 0) {
const input = form.querySelector(`[name="${key}"]`);
const should_submit_empty = input && input.dataset["smartformsSubmitEmpty"];
if (!should_submit_empty) {
continue;
}
}
const elements = key.split(".");
let current = json;
for (const element of elements.slice(0, elements.length - 1)) {