diff --git a/frontend/src/components/team/TeamPlanningBoard.vue b/frontend/src/components/team/TeamPlanningBoard.vue
index b71f55d8..9c050a39 100644
--- a/frontend/src/components/team/TeamPlanningBoard.vue
+++ b/frontend/src/components/team/TeamPlanningBoard.vue
@@ -61,6 +61,14 @@
:placeholder="t('teamManagement.teamName')"
@input="$emit('update-team-field', team.id, 'name', $event.target.value)"
>
+
@@ -189,6 +197,7 @@ export default {
'remove-member-from-team',
'update-team-field',
'remove-planning-team',
+ 'convert-planning-team',
'mark-member-interested'
],
methods: {
diff --git a/frontend/src/views/TeamManagementView.vue b/frontend/src/views/TeamManagementView.vue
index dc133cb3..e46da5f7 100644
--- a/frontend/src/views/TeamManagementView.vue
+++ b/frontend/src/views/TeamManagementView.vue
@@ -61,6 +61,7 @@
@mark-member-interested="onPlanningMarkMemberInterested"
@update-team-field="updatePlanningTeamField"
@remove-planning-team="removePlanningTeam"
+ @convert-planning-team="convertPlanningTeamToRegular"
/>
@@ -1488,6 +1489,25 @@ export default {
}
};
+ const convertPlanningTeamToRegular = async (teamId) => {
+ const team = teams.value.find((entry) => Number(entry.id) === Number(teamId));
+ if (!team) return;
+
+ activeMainSection.value = 'overview';
+ await editTeam(team);
+ teamFormIsOpen.value = true;
+ activeEditorSection.value = 'basic';
+
+ if (!team.leagueId) {
+ await showInfo(
+ t('teamManagement.editTeam'),
+ t('teamManagement.leagueFieldRequired'),
+ '',
+ 'info'
+ );
+ }
+ };
+
const toggleNewTeam = () => {
teamFormIsOpen.value = !teamFormIsOpen.value;
if (!teamFormIsOpen.value) {
@@ -1551,13 +1571,18 @@ export default {
if (!newTeamName.value.trim() || !selectedClub.value || !selectedSeasonId.value) return;
try {
+ const normalizedLeagueId = newLeagueId.value || null;
+ const shouldClearPlannedLeague =
+ !!teamToEdit.value &&
+ !!normalizedLeagueId &&
+ !!String(teamToEdit.value?.plannedLeagueName || '').trim();
const teamData = {
name: newTeamName.value.trim(),
- leagueId: newLeagueId.value || null,
+ leagueId: normalizedLeagueId,
seasonId: selectedSeasonId.value,
teamGender: newTeamGender.value,
teamAgeGroup: newTeamAgeGroup.value,
- plannedLeagueName: newPlannedLeagueName.value.trim() || null
+ plannedLeagueName: shouldClearPlannedLeague ? null : (newPlannedLeagueName.value.trim() || null)
};
if (teamToEdit.value) {
@@ -2874,6 +2899,7 @@ export default {
editTeam,
deleteTeam,
removePlanningTeam,
+ convertPlanningTeamToRegular,
uploadCodeList,
uploadPinList,
loadTeamDocuments,