added players

This commit is contained in:
2026-02-16 21:31:02 +11:00
parent bb3bed3e89
commit f8090aa0cc
17 changed files with 168 additions and 39 deletions

View File

@@ -18,8 +18,8 @@ func SeasonLeagueAddTeam(
conn *db.DB,
) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
seasonStr := r.PathValue("season_short_name")
leagueStr := r.PathValue("league_short_name")
seasonShortName := r.PathValue("season_short_name")
leagueShortName := r.PathValue("league_short_name")
getter, ok := validation.ParseFormOrNotify(s, w, r)
if !ok {
@@ -36,7 +36,7 @@ func SeasonLeagueAddTeam(
if ok := conn.WithNotifyTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
var err error
team, season, league, err = db.NewTeamParticipation(ctx, tx, seasonStr, leagueStr, teamID, db.NewAudit(r, nil))
team, season, league, err = db.NewTeamParticipation(ctx, tx, seasonShortName, leagueShortName, teamID, db.NewAuditFromRequest(r))
if err != nil {
if db.IsBadRequest(err) {
w.WriteHeader(http.StatusBadRequest)