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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user