draft seasons get special treatment :)
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user