satellite/console : remove code for creating user credit in CreateUser, skip TestUserCredits (#3680)
* remove code for creating user credit in CreateUser, skip TestUserCredits
This commit is contained in:
parent
b1fa7cdfbb
commit
52851026a7
@ -368,21 +368,23 @@ func (s *Service) CreateUser(ctx context.Context, user CreateUser, tokenSecret R
|
||||
}
|
||||
|
||||
if currentReward != nil {
|
||||
var refID *uuid.UUID
|
||||
if refUserID != "" {
|
||||
refID, err = uuid.Parse(refUserID)
|
||||
if err != nil {
|
||||
return Error.Wrap(err)
|
||||
}
|
||||
}
|
||||
newCredit, err := NewCredit(currentReward, Invitee, u.ID, refID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.UserCredits().Create(ctx, *newCredit)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = currentReward
|
||||
// NB: Uncomment this block when UserCredits().Create is cockroach compatible
|
||||
// var refID *uuid.UUID
|
||||
// if refUserID != "" {
|
||||
// refID, err = uuid.Parse(refUserID)
|
||||
// if err != nil {
|
||||
// return Error.Wrap(err)
|
||||
// }
|
||||
// }
|
||||
// newCredit, err := NewCredit(currentReward, Invitee, u.ID, refID)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// err = tx.UserCredits().Create(ctx, *newCredit)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
)
|
||||
|
||||
func TestUserCredits(t *testing.T) {
|
||||
t.Skip("Skip until usercredits.Create method is cockroach compatible. https://github.com/cockroachdb/cockroach/issues/42881")
|
||||
satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) {
|
||||
ctx := testcontext.New(t)
|
||||
defer ctx.Cleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user