UpdateNameAndLastName updates the first and last name of a user
(ctx context.Context, userID uuid.UUID, firstName, lastName *string)
| 76 | |
| 77 | // UpdateNameAndLastName updates the first and last name of a user |
| 78 | func (r *userRepo) UpdateNameAndLastName(ctx context.Context, userID uuid.UUID, firstName, lastName *string) (*biz.User, error) { |
| 79 | ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.UpdateNameAndLastName") |
| 80 | defer span.End() |
| 81 | |
| 82 | u, err := r.data.DB.User.UpdateOneID(userID).SetNillableFirstName(firstName).SetNillableLastName(lastName).SetUpdatedAt(time.Now()).Save(ctx) |
| 83 | if err != nil { |
| 84 | return nil, fmt.Errorf("error updating user name: %w", err) |
| 85 | } |
| 86 | |
| 87 | return entUserToBizUser(u), nil |
| 88 | } |
| 89 | |
| 90 | // Find by ID, returns nil if not found |
| 91 | func (r *userRepo) FindByID(ctx context.Context, userID uuid.UUID) (*biz.User, error) { |
nothing calls this directly
no test coverage detected