defekter floorplan
This commit is contained in:
@@ -403,8 +403,23 @@ foreach ($floors as $floor) {
|
||||
<script>
|
||||
function confirmDelete(id) {
|
||||
if (confirm('Diesen Standort wirklich löschen?')) {
|
||||
// TODO: AJAX-Delete implementieren
|
||||
alert('Löschen noch nicht implementiert');
|
||||
fetch('?module=locations&action=delete&id=' + encodeURIComponent(id), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data && data.success) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
alert((data && data.message) ? data.message : 'Löschen fehlgeschlagen');
|
||||
})
|
||||
.catch(() => {
|
||||
alert('Löschen fehlgeschlagen');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,3 +435,4 @@ function confirmFloorDelete(id) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user