admin: Really expose route to update team history

Related-to: a35aa7be70
This commit is contained in:
nemunaire 2024-03-12 10:21:13 +01:00
commit c7fc18bfb4
2 changed files with 17 additions and 7 deletions

View file

@ -55,7 +55,7 @@ func (t *Team) GetHistory() ([]map[string]interface{}, error) {
}
// UpdateHistoryCoeff updates the coefficient for a given entry.
func (t *Team) UpdateHistoryCoeff(kind string, h time.Time, givenId int64, newCoeff float32) (interface{}, error) {
func (t *Team) UpdateHistoryCoeff(kind string, h time.Time, givenId int64, newCoeff float32) (int64, error) {
if kind == "hint" {
if res, err := DBExec("UPDATE team_hints SET coefficient = ? WHERE id_team = ? AND time = ? AND id_hint = ?", newCoeff, t.Id, h, givenId); err != nil {
return 0, err
@ -81,7 +81,7 @@ func (t *Team) UpdateHistoryCoeff(kind string, h time.Time, givenId int64, newCo
return nb, err
}
} else {
return nil, nil
return 0, nil
}
}