From 47a815dd7195f6354c2758c604572d7139d91f3d Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Fri, 30 Jan 2026 23:12:44 +0100 Subject: [PATCH] feat(tournament): enhance tournament creation with group settings and winning sets logic - Updated the tournamentService to set default values for tournament type, number of groups, and advancing participants for group tournaments. - Adjusted the frontend logic to dynamically determine the number of winning sets based on the mini championship year, ensuring proper configuration for tournaments. --- backend/services/tournamentService.js | 4 +++- frontend/src/views/TournamentTab.vue | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/services/tournamentService.js b/backend/services/tournamentService.js index 9a90a10..82e7694 100644 --- a/backend/services/tournamentService.js +++ b/backend/services/tournamentService.js @@ -743,7 +743,9 @@ class TournamentService { name: tournamentName, date, clubId: +clubId, - type: '', + type: 'groups', + numberOfGroups: 1, + advancingPerGroup: 1, winningSets: sets, allowsExternal: false, miniChampionshipYear: Y diff --git a/frontend/src/views/TournamentTab.vue b/frontend/src/views/TournamentTab.vue index 99c5fbc..46675b7 100644 --- a/frontend/src/views/TournamentTab.vue +++ b/frontend/src/views/TournamentTab.vue @@ -1208,7 +1208,10 @@ export default { const tournament = tRes.data; this.currentTournamentName = tournament.name || ''; this.currentTournamentDate = tournament.date || ''; - this.currentWinningSets = tournament.winningSets || 3; + const defaultSets = tournament.miniChampionshipYear != null ? 1 : 3; + this.currentWinningSets = (tournament.winningSets != null && tournament.winningSets >= 1) + ? tournament.winningSets + : defaultSets; this.isGroupTournament = tournament.type === 'groups'; // Defensive: Backend/DB kann (historisch/UI-default) 0/null liefern. // Für gruppenbasierte Turniere ohne Klassen brauchen wir hier aber eine sinnvolle Zahl,