feat(Tournament): add doubles tournament support and related UI enhancements
- Updated tournamentController.js and tournamentService.js to include isDoublesTournament parameter for tournament creation and updates. - Modified Tournament model to add isDoublesTournament field, allowing differentiation between singles and doubles tournaments. - Enhanced frontend components (TournamentConfigTab, TournamentParticipantsTab, TournamentTab) to support doubles tournament configuration and display. - Added internationalization keys for doubles tournament labels and hints in multiple languages. - Improved participant assignment logic for doubles tournaments to ensure proper class assignments.
This commit is contained in:
@@ -62,9 +62,9 @@ export const getTournaments = async (req, res) => {
|
||||
// 2. Neues Turnier anlegen
|
||||
export const addTournament = async (req, res) => {
|
||||
const { authcode: token } = req.headers;
|
||||
const { clubId, tournamentName, date, winningSets, allowsExternal } = req.body;
|
||||
const { clubId, tournamentName, date, winningSets, allowsExternal, isDoublesTournament } = req.body;
|
||||
try {
|
||||
const tournament = await tournamentService.addTournament(token, clubId, tournamentName, date, winningSets, allowsExternal);
|
||||
const tournament = await tournamentService.addTournament(token, clubId, tournamentName, date, winningSets, allowsExternal, isDoublesTournament);
|
||||
if (clubId && tournament && tournament.id) {
|
||||
emitTournamentChanged(clubId, tournament.id);
|
||||
}
|
||||
@@ -271,9 +271,9 @@ export const getTournament = async (req, res) => {
|
||||
export const updateTournament = async (req, res) => {
|
||||
const { authcode: token } = req.headers;
|
||||
const { clubId, tournamentId } = req.params;
|
||||
const { name, date, winningSets, numberOfTables } = req.body;
|
||||
const { name, date, winningSets, numberOfTables, isDoublesTournament } = req.body;
|
||||
try {
|
||||
const tournament = await tournamentService.updateTournament(token, clubId, tournamentId, name, date, winningSets, numberOfTables);
|
||||
const tournament = await tournamentService.updateTournament(token, clubId, tournamentId, name, date, winningSets, numberOfTables, isDoublesTournament);
|
||||
// Emit Socket-Event
|
||||
emitTournamentChanged(clubId, tournamentId);
|
||||
res.status(200).json(tournament);
|
||||
@@ -748,4 +748,4 @@ export const deletePairing = async (req, res) => {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user