added seasons list
This commit is contained in:
@@ -34,7 +34,7 @@ func (user *User) ChangeUsername(ctx context.Context, tx bun.Tx, newUsername str
|
||||
Where("id = ?", user.ID).
|
||||
Exec(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "tx.Update")
|
||||
return errors.Wrap(err, "tx.NewUpdate")
|
||||
}
|
||||
user.Username = newUsername
|
||||
return nil
|
||||
@@ -55,7 +55,7 @@ func CreateUser(ctx context.Context, tx bun.Tx, username string, discorduser *di
|
||||
Model(user).
|
||||
Exec(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "tx.Insert")
|
||||
return nil, errors.Wrap(err, "tx.NewInsert")
|
||||
}
|
||||
|
||||
return user, nil
|
||||
@@ -75,7 +75,7 @@ func GetUserByID(ctx context.Context, tx bun.Tx, id int) (*User, error) {
|
||||
if err.Error() == "sql: no rows in result set" {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.Wrap(err, "tx.Select")
|
||||
return nil, errors.Wrap(err, "tx.NewSelect")
|
||||
}
|
||||
return user, nil
|
||||
}
|
||||
@@ -111,7 +111,7 @@ func GetUserByDiscordID(ctx context.Context, tx bun.Tx, discordID string) (*User
|
||||
if err.Error() == "sql: no rows in result set" {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.Wrap(err, "tx.Select")
|
||||
return nil, errors.Wrap(err, "tx.NewSelect")
|
||||
}
|
||||
return user, nil
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func IsUsernameUnique(ctx context.Context, tx bun.Tx, username string) (bool, er
|
||||
Where("username = ?", username).
|
||||
Count(ctx)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "tx.Count")
|
||||
return false, errors.Wrap(err, "tx.NewSelect")
|
||||
}
|
||||
return count == 0, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user