refactor: update api and client to reference humanIds
This commit is contained in:
@@ -14,6 +14,8 @@ type Service interface {
|
||||
GetOrCreateByEmail(ctx context.Context, email string) (*Human, error)
|
||||
// GetByEmail returns ErrNotFound if no human found
|
||||
GetByEmail(ctx context.Context, email string) (*Human, error)
|
||||
// GetByID returns ErrNotFound if no human found
|
||||
GetByID(ctx context.Context, id string) (*Human, error)
|
||||
}
|
||||
|
||||
type serviceImpl struct {
|
||||
@@ -52,3 +54,11 @@ func (s *serviceImpl) GetByEmail(ctx context.Context, email string) (*Human, err
|
||||
}
|
||||
return h, err
|
||||
}
|
||||
|
||||
func (s *serviceImpl) GetByID(ctx context.Context, id string) (*Human, error) {
|
||||
h, err := s.repo.getByID(ctx, id)
|
||||
if errors.Is(err, errNotFound) {
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
return h, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user