Find by ID, returns nil if not found
(ctx context.Context, userID uuid.UUID)
| 89 | |
| 90 | // Find by ID, returns nil if not found |
| 91 | func (r *userRepo) FindByID(ctx context.Context, userID uuid.UUID) (*biz.User, error) { |
| 92 | ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.FindByID") |
| 93 | defer span.End() |
| 94 | |
| 95 | u, err := r.data.DB.User.Get(ctx, userID) |
| 96 | if err != nil && !ent.IsNotFound(err) { |
| 97 | return nil, err |
| 98 | } else if u == nil { |
| 99 | return nil, nil |
| 100 | } |
| 101 | |
| 102 | return entUserToBizUser(u), nil |
| 103 | } |
| 104 | |
| 105 | func (r *userRepo) Delete(ctx context.Context, userID uuid.UUID) (err error) { |
| 106 | ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.Delete") |
no test coverage detected