MCPcopy Index your code
hub / github.com/chainloop-dev/chainloop / CreateByEmail

Method CreateByEmail

app/controlplane/pkg/data/user.go:64–75  ·  view source on GitHub ↗
(ctx context.Context, email string, firstName, lastName *string)

Source from the content-addressed store, hash-verified

62}
63
64func (r *userRepo) CreateByEmail(ctx context.Context, email string, firstName, lastName *string) (*biz.User, error) {
65 ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.CreateByEmail")
66 defer span.End()
67
68 u, err := r.data.DB.User.Create().SetEmail(email).SetNillableFirstName(firstName).SetNillableLastName(lastName).Save(ctx)
69 if err != nil {
70 return nil, err
71 }
72
73 // Query it to load the fully formed object, including proper casted dates that come from the DB
74 return r.FindByID(ctx, u.ID)
75}
76
77// UpdateNameAndLastName updates the first and last name of a user
78func (r *userRepo) UpdateNameAndLastName(ctx context.Context, userID uuid.UUID, firstName, lastName *string) (*biz.User, error) {

Callers

nothing calls this directly

Calls 7

FindByIDMethod · 0.95
StartFunction · 0.92
SaveMethod · 0.65
CreateMethod · 0.65
SetNillableLastNameMethod · 0.45
SetNillableFirstNameMethod · 0.45
SetEmailMethod · 0.45

Tested by

no test coverage detected