diff --git a/bin/evening_detective_server b/bin/evening_detective_server index 6d29c45..26d8868 100755 Binary files a/bin/evening_detective_server and b/bin/evening_detective_server differ diff --git a/internal/repos/tickets_repo/repo.go b/internal/repos/tickets_repo/repo.go index cfe7ea9..b680b0f 100644 --- a/internal/repos/tickets_repo/repo.go +++ b/internal/repos/tickets_repo/repo.go @@ -56,8 +56,10 @@ func (r *Repo) CreateBatch(ctx context.Context, gameID int, tokenHashes [][]byte func (r *Repo) GetByHash(ctx context.Context, tokenHash []byte) (*Info, error) { info := &Info{} err := r.pool.QueryRow(ctx, ` - SELECT t.id, t.status, g.name, g.start_at, g.location, g.status, t.used_at - FROM tickets t JOIN games g ON g.id = t.game_id + SELECT t.id, t.status, s.name, g.start_at, g.location, g.status, t.used_at + FROM tickets t + JOIN games g ON g.id = t.game_id + JOIN scenarios s ON s.id = g.scenario_id WHERE t.token_hash = $1`, tokenHash).Scan( &info.ID, &info.Status, &info.GameName, &info.StartAt, &info.Location, &info.GameStatus, &info.UsedAt) if errors.Is(err, pgx.ErrNoRows) {