generated from VLADIMIR/template
fix
This commit is contained in:
Binary file not shown.
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user