small fixes for confirm invite user
This commit is contained in:
parent
17256dff39
commit
78d6fdd3db
|
@ -1028,16 +1028,18 @@ public class UserServiceImpl implements UserService {
|
|||
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first();
|
||||
if (userCredential == null) throw new MyApplicationException();
|
||||
|
||||
TenantUserEntity tenantUserEntity = new TenantUserEntity();
|
||||
tenantUserEntity.setId(UUID.randomUUID());
|
||||
tenantUserEntity.setUserId(userId);
|
||||
tenantUserEntity.setIsActive(IsActive.Active);
|
||||
if (tenant != null) tenantUserEntity.setTenantId(tenant.getId());
|
||||
else tenantUserEntity.setTenantId(null);
|
||||
tenantUserEntity.setCreatedAt(Instant.now());
|
||||
tenantUserEntity.setUpdatedAt(Instant.now());
|
||||
this.entityManager.persist(tenantUserEntity);
|
||||
this.eventBroker.emit(new UserAddedToTenantEvent(tenantUserEntity.getUserId(), tenantUserEntity.getTenantId()));
|
||||
if (tenant != null){
|
||||
TenantUserEntity tenantUserEntity = new TenantUserEntity();
|
||||
tenantUserEntity.setId(UUID.randomUUID());
|
||||
tenantUserEntity.setUserId(userId);
|
||||
tenantUserEntity.setIsActive(IsActive.Active);
|
||||
tenantUserEntity.setTenantId(tenant.getId());
|
||||
tenantUserEntity.setCreatedAt(Instant.now());
|
||||
tenantUserEntity.setUpdatedAt(Instant.now());
|
||||
this.entityManager.persist(tenantUserEntity);
|
||||
this.eventBroker.emit(new UserAddedToTenantEvent(tenantUserEntity.getUserId(), tenantUserEntity.getTenantId()));
|
||||
}
|
||||
|
||||
|
||||
for (String role: userInviteToTenantRequest.getRoles()) {
|
||||
UserRoleEntity item = new UserRoleEntity();
|
||||
|
|
Loading…
Reference in New Issue