Forgot to fetch Name
This commit is contained in:
parent
8d3f38fdd0
commit
bf62a62978
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ func GetUserByEmail(dbPool *pgxpool.Pool, email string) (*User, error) {
|
|||
|
||||
var user User
|
||||
// Ensure the ID is being scanned as a string.
|
||||
err := dbPool.QueryRow(context.Background(), "SELECT id::text, email, password FROM users WHERE email = $1", email).Scan(&user.ID, &user.Email, &user.Password)
|
||||
err := dbPool.QueryRow(context.Background(), "SELECT id::text, name, email, password FROM users WHERE email = $1", email).Scan(&user.ID, &user.Name, &user.Email, &user.Password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func GetUserByID(dbPool *pgxpool.Pool, id string) (*User, error) {
|
|||
|
||||
var user User
|
||||
// Ensure the ID is being scanned as a string.
|
||||
err := dbPool.QueryRow(context.Background(), "SELECT id::text, email, password FROM users WHERE id = $1", id).Scan(&user.ID, &user.Email, &user.Password)
|
||||
err := dbPool.QueryRow(context.Background(), "SELECT id::text, name, email, password FROM users WHERE id = $1", id).Scan(&user.ID, &user.Name, &user.Email, &user.Password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue