Fix: save action on give-clue

This commit is contained in:
Grail Finder
2025-07-04 12:44:15 +03:00
parent c2d6812230
commit 058d501774
3 changed files with 44 additions and 3 deletions

View File

@ -329,6 +329,7 @@ func HandleGiveClue(w http.ResponseWriter, r *http.Request) {
}
// ===
action := models.Action{
RoomID: fi.Room.ID,
Actor: fi.State.Username,
ActorColor: string(fi.State.Team),
WordColor: string(fi.State.Team),
@ -337,6 +338,10 @@ func HandleGiveClue(w http.ResponseWriter, r *http.Request) {
Number: num,
}
fi.Room.ActionHistory = append(fi.Room.ActionHistory, action)
if err := repo.CreateAction(r.Context(), &action); err != nil {
abortWithError(w, err.Error())
return
}
fi.Room.MimeDone = true
fi.Room.ThisTurnLimit = uint8(guessLimitU64) + 1
if guessLimitU64 == 0 {