diff --git a/frontend/src/components/TrainingGroupsTab.vue b/frontend/src/components/TrainingGroupsTab.vue index 016f788f..efcc547f 100644 --- a/frontend/src/components/TrainingGroupsTab.vue +++ b/frontend/src/components/TrainingGroupsTab.vue @@ -227,14 +227,14 @@ export default { const filteredMembers = members.filter(m => m != null); // Sortiere alphabetisch nach Nachname, dann Vorname this.members = filteredMembers.sort((a, b) => { - const lastNameA = (a.lastName || '').toLowerCase(); - const lastNameB = (b.lastName || '').toLowerCase(); - if (lastNameA !== lastNameB) { - return lastNameA.localeCompare(lastNameB); - } const firstNameA = (a.firstName || '').toLowerCase(); const firstNameB = (b.firstName || '').toLowerCase(); - return firstNameA.localeCompare(firstNameB); + if (firstNameA !== firstNameB) { + return firstNameA.localeCompare(firstNameB); + } + const lastNameA = (a.lastName || '').toLowerCase(); + const lastNameB = (b.lastName || '').toLowerCase(); + return lastNameA.localeCompare(lastNameB); }); console.log('[loadMembers] Loaded', this.members.length, 'active members'); } catch (error) {