Fix: Commander db name in types

This commit is contained in:
zuma 2025-06-10 23:17:50 +02:00
parent dbcf5decb8
commit 8db4870057
2 changed files with 3 additions and 2 deletions

View file

@ -256,6 +256,7 @@ func updateEloCommanderWithLastMatch(e *core.RecordEvent, commanderId string, da
AndWhere(dbx.Or(dbx.NewExp("commandant_1 = {:id}", dbx.Params{"id": commanderId}), dbx.NewExp("commandant_2 = {:id}", dbx.Params{"id": commanderId}))).
OrderBy("date DESC").
One(&lastMatch)
if err == nil {
// If a match exists before this one update ELO
if lastMatch.Commander1 == commanderId {

View file

@ -61,8 +61,8 @@ type Elo struct {
Date string `db:"date" json:"date"`
Player1 string `db:"player_1" json:"player_1"`
Player2 string `db:"player_2" json:"player_2"`
Commander1 string `db:"commander_1" json:"commander_1"`
Commander2 string `db:"commander_2" json:"commander_2"`
Commander1 string `db:"commandant_1" json:"commander_1"`
Commander2 string `db:"commandant_2" json:"commander_2"`
Score1 int `db:"score_1" json:"score_1"`
Score2 int `db:"score_2" json:"score_2"`
Official bool `db:"official" json:"official"`