everybody loves a refactor

This commit is contained in:
2026-02-15 12:27:36 +11:00
parent 61890ae20b
commit ef8c022e60
44 changed files with 278 additions and 234 deletions

View File

@@ -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"
teamsview "git.haelnorr.com/h/oslstats/internal/view/teamsview"
)
@@ -88,8 +89,7 @@ func NewTeamSubmit(
notify.Warn(s, w, r, "Duplicate Short Names", "This combination of short names is already taken.", nil)
return
}
w.Header().Set("HX-Redirect", "/teams")
w.WriteHeader(http.StatusOK)
respond.HXRedirect(w, "teams")
notify.SuccessWithDelay(s, w, r, "Team Created", fmt.Sprintf("Successfully created team: %s", name), nil)
})
}