fix: ensure leagueId is retained when editing a team to prevent accidental removal of MyTischtennis link
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 51s

This commit is contained in:
Torsten Schulz (local)
2026-07-17 14:53:06 +02:00
parent 51b620f496
commit 7bf7ae2bef
2 changed files with 27 additions and 25 deletions

View File

@@ -1578,12 +1578,16 @@ export default {
!!String(teamToEdit.value?.plannedLeagueName || '').trim();
const teamData = {
name: newTeamName.value.trim(),
leagueId: normalizedLeagueId,
seasonId: selectedSeasonId.value,
teamGender: newTeamGender.value,
teamAgeGroup: newTeamAgeGroup.value,
plannedLeagueName: shouldClearPlannedLeague ? null : (newPlannedLeagueName.value.trim() || null)
};
// Beim Bearbeiten darf ein leeres Auswahlfeld die bestehende Liga- und
// damit die MyTischtennis-Verknüpfung nicht versehentlich entfernen.
if (!teamToEdit.value || normalizedLeagueId) {
teamData.leagueId = normalizedLeagueId;
}
if (teamToEdit.value) {
// Bearbeitung eines bestehenden Teams