generated from VLADIMIR/template
clear
This commit is contained in:
@@ -32,7 +32,7 @@ func (r *TeamsRepo) GetTeamByID(ctx context.Context, id int) (*repos.Team, error
|
||||
name,
|
||||
status,
|
||||
password,
|
||||
scenario_id
|
||||
game_id
|
||||
FROM teams
|
||||
WHERE id = $1`,
|
||||
id,
|
||||
@@ -42,7 +42,7 @@ func (r *TeamsRepo) GetTeamByID(ctx context.Context, id int) (*repos.Team, error
|
||||
&team.Name,
|
||||
&team.Status,
|
||||
&team.Password,
|
||||
&team.ScenarioId,
|
||||
&team.GameId,
|
||||
)
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
@@ -101,19 +101,17 @@ func (r *TeamsRepo) AddTeam(
|
||||
creatorId int,
|
||||
gameId int,
|
||||
name string,
|
||||
scenarioId int,
|
||||
password string,
|
||||
) (int, error) {
|
||||
id := 0
|
||||
err := r.pool.QueryRow(
|
||||
ctx,
|
||||
`INSERT INTO teams (name, creator_id, game_id, scenario_id, password)
|
||||
VALUES ($1, $2, $3, $4, $5)
|
||||
`INSERT INTO teams (name, creator_id, game_id, password)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING id`,
|
||||
name,
|
||||
creatorId,
|
||||
gameId,
|
||||
scenarioId,
|
||||
password,
|
||||
).Scan(&id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user