This commit is contained in:
2026-09-18 17:25:06 +07:00
parent 04e53301d2
commit ca7659f732
2 changed files with 4 additions and 2 deletions
Binary file not shown.
+4 -2
View File
@@ -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) {