fix event edit not working closes #3

This commit is contained in:
Adrian Zürcher
2025-11-05 11:30:56 +01:00
parent 7b760afeb3
commit 9866cc3ffd
7 changed files with 10 additions and 6 deletions

View File

@@ -68,13 +68,15 @@ async function save() {
if (!valid) return;
let query = 'events/edit?id=' + localEvent.value.id;
let query = 'events/edit';
let payload = JSON.stringify([localEvent.value]);
if (newEvent.value) {
query = 'events/add?name=' + localEvent.value.name;
payload = JSON.stringify(localEvent.value);
}
appApi
.post(query, JSON.stringify(localEvent.value))
.post(query, payload)
.then(() => {
emit('update');
dialog.value.close();