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

@@ -407,20 +407,20 @@ const saveMember = async () => {
}
const confirmDelete = async (member) => {
if (!confirm(`Möchten Sie "${member.name}" wirklich löschen?`)) {
return
}
window.showConfirmModal('Mitglied löschen', `Möchten Sie "${member.name}" wirklich löschen?`, async () => {
try {
await $fetch('/api/members', {
method: 'DELETE',
body: { id: member.id }
})
try {
await $fetch('/api/members', {
method: 'DELETE',
body: { id: member.id }
})
await loadMembers()
} catch (error) {
alert('Fehler beim Löschen des Mitglieds.')
}
await loadMembers()
window.showSuccessModal('Erfolg', 'Mitglied wurde erfolgreich gelöscht')
} catch (error) {
console.error('Fehler beim Löschen:', error)
window.showErrorModal('Fehler', 'Fehler beim Löschen des Mitglieds')
}
})
}
const formatDate = (dateString) => {