Feat: settings repo

This commit is contained in:
Grail Finder
2025-07-04 13:32:59 +03:00
parent 058d501774
commit 6be365473c
9 changed files with 72 additions and 19 deletions

View File

@ -60,10 +60,6 @@ func (p *RepoProvider) RoomDeleteByID(ctx context.Context, id string) error {
func (p *RepoProvider) RoomUpdate(ctx context.Context, r *models.Room) error {
db := getDB(ctx, p.DB)
_, err := db.ExecContext(ctx, `UPDATE rooms SET team_turn = ?, this_turn_limit = ?, opened_this_turn = ?, blue_counter = ?, red_counter = ?, red_turn = ?, mime_done = ?, is_running = ?, is_over = ?, team_won = ?, room_link = ? WHERE id = ?`, r.TeamTurn, r.ThisTurnLimit, r.OpenedThisTurn, r.BlueCounter, r.RedCounter, r.RedTurn, r.MimeDone, r.IsRunning, r.IsOver, r.TeamWon, r.RoomLink, r.ID)
if err != nil {
return err
}
_, err = db.ExecContext(ctx, `UPDATE settings SET language = ?, room_pass = ?, turn_time = ? WHERE room_id = ?`, r.Settings.Language, r.Settings.RoomPass, r.Settings.RoundTime, r.ID)
return err
}