saveForm-Function macht jetzt einen async fetch (Admin Panel Formulare)
This commit is contained in:
@@ -14,8 +14,15 @@ RitzenbergenLib.Formular.getForms().then(
|
|||||||
(result) => (formulare.value = result)
|
(result) => (formulare.value = result)
|
||||||
);
|
);
|
||||||
|
|
||||||
function saveForm(form) {
|
async function saveForm(form) {
|
||||||
console.log(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) {
|
function filterType(type: string) {
|
||||||
if (type in ["radio", "checkbox"]) return "text";
|
if (type in ["radio", "checkbox"]) return "text";
|
||||||
|
|||||||
Reference in New Issue
Block a user