small fix

This commit is contained in:
amentis 2024-06-21 16:27:29 +03:00
parent b89df00925
commit d2d889f011
1 changed files with 4 additions and 1 deletions

View File

@ -1011,6 +1011,9 @@ public class UserServiceImpl implements UserService {
} }
this.addUserToTenant(tenantEntity, userInviteToTenantRequest); this.addUserToTenant(tenantEntity, userInviteToTenantRequest);
action.setStatus(ActionConfirmationStatus.Accepted);
this.entityManager.merge(action);
} }
private void addUserToTenant(TenantEntity tenant, UserInviteToTenantRequestEntity userInviteToTenantRequest) throws InvalidApplicationException { private void addUserToTenant(TenantEntity tenant, UserInviteToTenantRequestEntity userInviteToTenantRequest) throws InvalidApplicationException {
@ -1023,7 +1026,7 @@ public class UserServiceImpl implements UserService {
if (contactInfoEntity != null){ if (contactInfoEntity != null){
userId = contactInfoEntity.getUserId(); userId = contactInfoEntity.getUserId();
} }
if (userId != this.userScope.getUserId()) throw new MyApplicationException("Cannot confirm invitation for different User");
if (userId != null) { if (userId != null) {
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first(); UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first();
if (userCredential == null) throw new MyApplicationException(); if (userCredential == null) throw new MyApplicationException();