admin: Really expose route to update team history
Related-to: a35aa7be70
This commit is contained in:
parent
a0bc832910
commit
c7fc18bfb4
2 changed files with 17 additions and 7 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue