feat: add number of tables to tournament updates and enhance related UI components
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 47s

This commit is contained in:
Torsten Schulz (local)
2026-05-16 00:18:59 +02:00
parent 40bd5e0745
commit f8f1c797e7
13 changed files with 436 additions and 30 deletions

View File

@@ -1849,8 +1849,8 @@ class TournamentService {
return JSON.parse(JSON.stringify(t));
}
// Update Turnier (Name, Datum und Gewinnsätze)
async updateTournament(userToken, clubId, tournamentId, name, date, winningSets) {
// Update Turnier (Name, Datum, Gewinnsätze und Tischanzahl)
async updateTournament(userToken, clubId, tournamentId, name, date, winningSets, numberOfTables) {
await checkAccess(userToken, clubId);
const tournament = await Tournament.findOne({ where: { id: tournamentId, clubId } });
if (!tournament) {
@@ -1873,6 +1873,12 @@ class TournamentService {
}
tournament.winningSets = winningSets;
}
if (numberOfTables !== undefined) {
if (numberOfTables !== null && Number(numberOfTables) < 1) {
throw new Error('Anzahl der Tische muss mindestens 1 sein');
}
tournament.numberOfTables = numberOfTables != null ? Number(numberOfTables) : null;
}
await tournament.save();
return JSON.parse(JSON.stringify(tournament));