fix(onboarding): could not create user (#848)

fix: onboarding not working
This commit is contained in:
ze0s 2023-04-17 20:56:17 +02:00 committed by GitHub
parent d03561d61c
commit 7f05dd1efd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 182 additions and 130 deletions

View file

@ -10,7 +10,7 @@ import (
type Service interface {
GetUserCount(ctx context.Context) (int, error)
FindByUsername(ctx context.Context, username string) (*domain.User, error)
CreateUser(ctx context.Context, user domain.User) error
CreateUser(ctx context.Context, req domain.CreateUserRequest) error
}
type service struct {
@ -36,7 +36,7 @@ func (s *service) FindByUsername(ctx context.Context, username string) (*domain.
return user, nil
}
func (s *service) CreateUser(ctx context.Context, newUser domain.User) error {
func (s *service) CreateUser(ctx context.Context, req domain.CreateUserRequest) error {
userCount, err := s.repo.GetUserCount(ctx)
if err != nil {
return err
@ -46,5 +46,5 @@ func (s *service) CreateUser(ctx context.Context, newUser domain.User) error {
return errors.New("only 1 user account is supported at the moment")
}
return s.repo.Store(ctx, newUser)
return s.repo.Store(ctx, req)
}