everybody loves a refactor
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"git.haelnorr.com/h/oslstats/internal/db"
|
||||
"git.haelnorr.com/h/oslstats/internal/notify"
|
||||
"git.haelnorr.com/h/oslstats/internal/respond"
|
||||
"git.haelnorr.com/h/oslstats/internal/validation"
|
||||
leaguesview "git.haelnorr.com/h/oslstats/internal/view/leaguesview"
|
||||
)
|
||||
@@ -78,8 +79,7 @@ func NewLeagueSubmit(
|
||||
notify.Warn(s, w, r, "Duplicate Short Name", "This short name is already taken.", nil)
|
||||
return
|
||||
}
|
||||
w.Header().Set("HX-Redirect", fmt.Sprintf("/leagues/%s", league.ShortName))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
respond.HXRedirect(w, "/leagues/%s", league.ShortName)
|
||||
notify.SuccessWithDelay(s, w, r, "League Created", fmt.Sprintf("Successfully created league: %s", name), nil)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user