refactoring
This commit is contained in:
@@ -68,14 +68,11 @@ func (s *UserService) Update(user *models.User) (*models.User, error) {
|
||||
if err := existingUser.FromID(s.DB, &user.ID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
user.MembershipID = existingUser.MembershipID
|
||||
user.Membership.ID = existingUser.Membership.ID
|
||||
if existingUser.Licence != nil {
|
||||
user.Licence.ID = existingUser.Licence.ID
|
||||
user.LicenceID = existingUser.LicenceID
|
||||
}
|
||||
user.BankAccount.ID = existingUser.BankAccount.ID
|
||||
user.BankAccountID = existingUser.BankAccountID
|
||||
|
||||
user.SetPassword(user.Password)
|
||||
|
||||
@@ -109,7 +106,6 @@ func (s *UserService) Register(user *models.User) (id uint, token string, err er
|
||||
user.Membership.SubscriptionModel = *selectedModel
|
||||
user.Membership.SubscriptionModelID = selectedModel.ID
|
||||
user.Status = constants.UnverifiedStatus
|
||||
user.PaymentStatus = constants.AwaitingPaymentStatus
|
||||
user.BankAccount.MandateDateSigned = time.Now()
|
||||
v, err := user.SetVerification(constants.VerificationTypes.Email)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user