forked from andyburke/autonomous.contact
refactor: more refactoring to topics as the top-level organization
This commit is contained in:
parent
11ecd86bb9
commit
4347d20263
18 changed files with 730 additions and 317 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue