Skip to content

Commit

Permalink
chore: create and save a dummy email for agent person
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Aug 8, 2023
1 parent 1a19d83 commit 5227153
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func generateAgent(ctx *api.Context, body api.GenerateAgentRequest) (*api.Genera
return nil, fmt.Errorf("failed to generate username and password: %w", err)
}

person, err := db.CreatePerson(ctx, username, "agent")
person, err := db.CreatePerson(ctx, username, fmt.Sprintf("%s@local", username), "agent")
if err != nil {
return nil, fmt.Errorf("failed to create a new person: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions db/people.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ type CreateUserRequest struct {
Properties models.PersonProperties
}

func CreatePerson(ctx *api.Context, name, personType string) (*models.Person, error) {
person := models.Person{Name: name, Type: personType}
func CreatePerson(ctx *api.Context, name, email, personType string) (*models.Person, error) {
person := models.Person{Name: name, Email: email, Type: personType}
if err := ctx.DB().Clauses(clause.Returning{}).Create(&person).Error; err != nil {
return nil, err
}
Expand Down

0 comments on commit 5227153

Please sign in to comment.