Skip to content

Commit

Permalink
Fix sql issue
Browse files Browse the repository at this point in the history
Signed-off-by: William <[email protected]>
  • Loading branch information
kwesidev committed Dec 5, 2023
1 parent 9c5714b commit b84565f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/services/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (usrSrv *UserService) Get(userId int) *models.User {
// GetUsername gets the usersDetails by username
func (usrSrv *UserService) GetByUsername(username string) *models.User {
var userId int
row := usrSrv.db.QueryRow("SELECT id FROM users WHERE username = $1 OR email_address = $2 LIMIT 1 ", username)
row := usrSrv.db.QueryRow("SELECT id FROM users WHERE username = $1 OR email_address = $1 LIMIT 1 ", username)
row.Scan(&userId)
return usrSrv.Get(userId)
}
Expand Down

0 comments on commit b84565f

Please sign in to comment.