fix unrecognized field

This commit is contained in:
Charles 2026-03-03 15:52:06 +01:00
parent a428cf92f3
commit 45e14c47ca
1 changed files with 6 additions and 12 deletions

View File

@ -142,18 +142,12 @@ class OrganizationsService
$roleAdmin = $this->entityManager->getRepository(Roles::class)->findOneBy(['name' => 'ADMIN']);
$adminUOs = $this->uoRepository->findBy(['organization' => $data['organization'], 'isActive' => true]);
$adminUOs = $this->uoRepository->findBy(['organization' => $data['organization'], 'isActive' => true, 'role' => $roleAdmin]);
foreach ($adminUOs as $adminUO) {
$uoa = $this->entityManager->getRepository(UsersOrganizations::class)
->findOneBy([
'userOrganization' => $adminUO,
'role' => $roleAdmin,
'isActive' => true
]);
switch ($type) {
case 'USER_ACCEPTED':
if ($uoa && $adminUO->getUsers()->getId() !== $data['user']->getId() ) {
if ($adminUO->getUsers()->getId() !== $data['user']->getId() ) {
$newUser = $data['user'];
$this->notificationService->notifyUserAcceptedInvite(
$adminUO->getUsers(),
@ -167,7 +161,7 @@ class OrganizationsService
}
break;
case 'USER_INVITED':
if ($uoa) {
if ($adminUO->getUsers()->getId() !== $data['user']->getId() ) {
$invitedUser = $data['user'];
$this->notificationService->notifyUserInvited(
$adminUO->getUsers(),
@ -182,7 +176,7 @@ class OrganizationsService
break;
case 'USER_DEACTIVATED':
if ($uoa && $adminUO->getUsers()->getId() !== $data['user']->getId() ) {
if ($adminUO->getUsers()->getId() !== $data['user']->getId() ) {
$removedUser = $data['user'];
$this->notificationService->notifyUserDeactivated(
$adminUO->getUsers(),
@ -197,7 +191,7 @@ class OrganizationsService
break;
case 'USER_DELETED':
if ($uoa && $adminUO->getUsers()->getId() !== $data['user']->getId() ) {
if ($adminUO->getUsers()->getId() !== $data['user']->getId() ) {
$removedUser = $data['user'];
$this->notificationService->notifyUserDeleted(
$adminUO->getUsers(),
@ -211,7 +205,7 @@ class OrganizationsService
}
break;
case 'USER_ACTIVATED':
if ($uoa && $adminUO->getUsers()->getId() !== $data['user']->getId() ) {
if ($adminUO->getUsers()->getId() !== $data['user']->getId() ) {
$activatedUser = $data['user'];
$this->notificationService->notifyUserActivated(
$adminUO->getUsers(),