feat: implement table assignment and distribution for tournament matches
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s
This commit is contained in:
@@ -247,6 +247,35 @@ export const getTournamentMatches = async (req, res) => {
|
||||
}
|
||||
};
|
||||
|
||||
// Setze Tischnummer für ein Spiel
|
||||
export const setMatchTable = async (req, res) => {
|
||||
const { authcode: token } = req.headers;
|
||||
const { clubId, tournamentId, matchId } = req.params;
|
||||
const { tableNumber } = req.body;
|
||||
try {
|
||||
const updated = await tournamentService.setMatchTable(token, clubId, tournamentId, matchId, tableNumber);
|
||||
emitTournamentChanged(clubId, tournamentId);
|
||||
res.status(200).json(updated);
|
||||
} catch (error) {
|
||||
console.error('[setMatchTable] Error:', error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
};
|
||||
|
||||
// Freie Tische verteilen (Batch)
|
||||
export const distributeTables = async (req, res) => {
|
||||
const { authcode: token } = req.headers;
|
||||
const { clubId, tournamentId } = req.body;
|
||||
try {
|
||||
const updated = await tournamentService.distributeTables(token, clubId, tournamentId);
|
||||
emitTournamentChanged(clubId, tournamentId);
|
||||
res.status(200).json({ updated, message: 'Tische wurden verteilt.' });
|
||||
} catch (error) {
|
||||
console.error('[distributeTables] Error:', error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
};
|
||||
|
||||
// 11. Satz-Ergebnis speichern
|
||||
export const addMatchResult = async (req, res) => {
|
||||
const { authcode: token } = req.headers;
|
||||
|
||||
Reference in New Issue
Block a user