saveForm-Function macht jetzt einen async fetch (Admin Panel Formulare)

This commit is contained in:
R40fendt
2026-01-04 18:13:00 +01:00
parent f5946b0429
commit 4bb654bf4d

View File

@@ -14,8 +14,15 @@ RitzenbergenLib.Formular.getForms().then(
(result) => (formulare.value = result)
);
function saveForm(form) {
console.log(form);
async function saveForm(form) {
return fetch(RitzenbergenLib.RitzenbergenLib.api("/admin/formulare/updateForm.php"),{
method: "POST",
body: JSON.stringify(form),
headers: {
"Content-Type":"application/json",
"Authorization":"Bearer "+token.value
}
})
}
function filterType(type: string) {
if (type in ["radio", "checkbox"]) return "text";