feat(tournaments): add update functionality for official tournaments

- Implemented an API endpoint to update the title of official tournaments, including error handling for non-existent tournaments.
- Enhanced the frontend to allow users to edit tournament titles directly, with input validation and feedback for successful updates or errors.
- Updated the German localization file to include new strings for editing titles and error messages.
This commit is contained in:
Torsten Schulz (local)
2026-03-10 21:54:03 +01:00
parent ea6acd8c6c
commit c13f426b3d
6 changed files with 136 additions and 5 deletions

View File

@@ -295,6 +295,14 @@ class OfficialTournamentService {
return out;
}
async updateOfficialTournament(clubId, id, { title }) {
const t = await OfficialTournament.findOne({ where: { id, clubId } });
if (!t) return null;
if (title !== undefined) t.title = title;
await t.save();
return t.toJSON();
}
async deleteOfficialTournament(clubId, id) {
const t = await OfficialTournament.findOne({ where: { id, clubId } });
if (!t) return false;