mirror of
https://github.com/MADTeacher/go_basics.git
synced 2025-11-23 21:34:47 +02:00
Глава 8
Допричесать игру
This commit is contained in:
@@ -38,9 +38,13 @@ func (r *SQLiteRepository) GetAllFinishedGames() (*[]m.FinishGameSnapshot, error
|
||||
return &finishGameSnapshots, nil
|
||||
}
|
||||
|
||||
func (r *SQLiteRepository) GetFinishedGameById(id int) (*m.FinishGameSnapshot, error) {
|
||||
func (r *SQLiteRepository) GetFinishedGameById(
|
||||
id int,
|
||||
) (*m.FinishGameSnapshot, error) {
|
||||
var playerFinishGame PlayerFinishGame
|
||||
if err := r.db.Where("id = ?", id).First(&playerFinishGame).Error; err != nil {
|
||||
if err := r.db.Where("id = ?", id).First(
|
||||
&playerFinishGame,
|
||||
).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return playerFinishGame.ToModel()
|
||||
|
||||
Reference in New Issue
Block a user