libfic: fix hint deletion in team history

This commit is contained in:
nemunaire 2018-11-25 06:04:57 +01:00
parent 521507b8e3
commit 17ef0b0a32

View file

@ -57,7 +57,7 @@ func (t Team) DelHistoryItem(kind string, h time.Time, primary *int64, secondary
return nb, err
}
} else if kind == "hint" && primary != nil {
if res, err := DBExec("DELETE FROM team_hints WHERE id_team = ? AND time = ? AND id_exercice = ?", t.Id, h, *primary); err != nil {
if res, err := DBExec("DELETE FROM team_hints WHERE id_team = ? AND time = ? AND id_hint = ?", t.Id, h, *secondary); err != nil {
return 0, err
} else if nb, err := res.RowsAffected(); err != nil {
return 0, err