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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user