draft seasons get special treatment :)

This commit is contained in:
2026-02-18 20:36:15 +11:00
parent b018628d4c
commit 6193fe2ab6
16 changed files with 416 additions and 78 deletions

View File

@@ -50,7 +50,11 @@ func SeasonLeagueAddTeam(
}
// Redirect to refresh the page
w.Header().Set("HX-Redirect", fmt.Sprintf("/seasons/%s/leagues/%s/teams", season.ShortName, league.ShortName))
redirectURL := fmt.Sprintf("/seasons/%s/leagues/%s/teams", season.ShortName, league.ShortName)
if season.Type == db.SeasonTypeDraft.String() {
redirectURL = fmt.Sprintf("/seasons/%s/teams", season.ShortName)
}
w.Header().Set("HX-Redirect", redirectURL)
w.WriteHeader(http.StatusOK)
notify.Success(s, w, r, "Team Added", fmt.Sprintf(
"Successfully added '%s' to the league.",