Refactor error and confirmation handling in membership application management; replace alerts with modal dialogs for improved user experience. Update application status to 'approved' for a new member and add corresponding data to JSON files.

This commit is contained in:
Torsten Schulz (local)
2025-10-23 15:32:20 +02:00
parent 9524a29b67
commit 6763b15487
13 changed files with 321 additions and 101 deletions

View File

@@ -238,26 +238,26 @@ const saveTermin = async () => {
}
const confirmDelete = async (termin) => {
if (!confirm(`Möchten Sie den Termin "${termin.titel}" wirklich löschen?`)) {
return
}
window.showConfirmModal('Termin löschen', `Möchten Sie den Termin "${termin.titel}" wirklich löschen?`, async () => {
try {
const params = new URLSearchParams({
datum: termin.datum,
titel: termin.titel,
beschreibung: termin.beschreibung || '',
kategorie: termin.kategorie || 'Sonstiges'
})
await $fetch(`/api/termine-manage?${params.toString()}`, {
method: 'DELETE'
})
try {
const params = new URLSearchParams({
datum: termin.datum,
titel: termin.titel,
beschreibung: termin.beschreibung || '',
kategorie: termin.kategorie || 'Sonstiges'
})
await $fetch(`/api/termine-manage?${params.toString()}`, {
method: 'DELETE'
})
await loadTermine()
} catch (error) {
alert('Fehler beim Löschen des Termins.')
}
await loadTermine()
window.showSuccessModal('Erfolg', 'Termin wurde erfolgreich gelöscht')
} catch (error) {
console.error('Fehler beim Löschen:', error)
window.showErrorModal('Fehler', 'Fehler beim Löschen des Termins')
}
})
}
const formatDate = (dateString) => {