Skip to content

Commit

Permalink
Merge pull request #88 from KnightHacks/development
Browse files Browse the repository at this point in the history
 fixed user id not being assigned in crate user
  • Loading branch information
LockedThread committed Jun 8, 2023
2 parents af5e265 + 0a75e1e commit bd48f07
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions repository/database/create_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
// must be able to run regardless of whether of it's input, that is why there is a
// lot of pointers for nil safety purposes
func (r *DatabaseRepository) CreateUser(ctx context.Context, oAuth *model.OAuth, input *model.NewUser) (*model.User, error) {
var userId string
var pronouns *model.Pronouns = nil
if input.Pronouns != nil {
// input.Pronouns is a PronounsInput struct which a direct copy of the Pronouns struct, so we need to copy its fields
Expand All @@ -28,7 +27,6 @@ func (r *DatabaseRepository) CreateUser(ctx context.Context, oAuth *model.OAuth,
}

user := &model.User{
ID: userId,
FirstName: input.FirstName,
LastName: input.LastName,
Email: input.Email,
Expand Down Expand Up @@ -109,7 +107,7 @@ func (r *DatabaseRepository) CreateUser(ctx context.Context, oAuth *model.OAuth,
}
}

userId = strconv.Itoa(userIdInt)
user.ID = strconv.Itoa(userIdInt)
return nil
})
if err != nil {
Expand Down

0 comments on commit bd48f07

Please sign in to comment.