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

@ -7,8 +7,8 @@ import (
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/internal/logger"
"github.com/autobrr/autobrr/pkg/errors"
sq "github.com/Masterminds/squirrel"
sq "github.com/Masterminds/squirrel"
"github.com/rs/zerolog"
)
@ -75,14 +75,14 @@ func (r *UserRepo) FindByUsername(ctx context.Context, username string) (*domain
return &user, nil
}
func (r *UserRepo) Store(ctx context.Context, user domain.User) error {
func (r *UserRepo) Store(ctx context.Context, req domain.CreateUserRequest) error {
var err error
queryBuilder := r.db.squirrel.
Insert("users").
Columns("username", "password").
Values(user.Username, user.Password)
Values(req.Username, req.Password)
query, args, err := queryBuilder.ToSql()
if err != nil {