diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-26 22:59:03 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-26 22:59:03 +0200 |
commit | 9ba53fea71728ce64342d0d59f4199876e4b6164 (patch) | |
tree | 5f06ef37ab8ac3d01a3a7c21b5c71b1e9fc11643 /pkg/database/sql/user.go | |
parent | 4d930c0c8cb585979798fac2bb254f991faa62fb (diff) | |
download | lens-9ba53fea71728ce64342d0d59f4199876e4b6164.tar.gz lens-9ba53fea71728ce64342d0d59f4199876e4b6164.tar.bz2 lens-9ba53fea71728ce64342d0d59f4199876e4b6164.zip |
feat: Partially fix test
This will totally be fixed later.
Diffstat (limited to 'pkg/database/sql/user.go')
-rw-r--r-- | pkg/database/sql/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/database/sql/user.go b/pkg/database/sql/user.go index a02b67b..a0884f4 100644 --- a/pkg/database/sql/user.go +++ b/pkg/database/sql/user.go @@ -137,7 +137,7 @@ func (self *UserRepository) GetPassword(ctx context.Context, id uint) ([]byte, e return userPassword.Password, nil } -func (self *UserRepository) Create(ctx context.Context, createUser *user.CreateUser) error { +func (self *UserRepository) Create(ctx context.Context, createUser *user.CreateUser) (uint, error) { user := &User{ Username: createUser.Username, Name: createUser.Name, @@ -148,10 +148,10 @@ func (self *UserRepository) Create(ctx context.Context, createUser *user.CreateU WithContext(ctx). Create(user) if result.Error != nil { - return result.Error + return 0, result.Error } - return nil + return user.Model.ID, nil } func (self *UserRepository) Update(ctx context.Context, id uint, update *user.UpdateUser) error { |