diff --git a/app/Jobs/FolderDeleteEntity.php b/app/Jobs/FolderDeleteEntity.php index 490faee..9ec9440 100644 --- a/app/Jobs/FolderDeleteEntity.php +++ b/app/Jobs/FolderDeleteEntity.php @@ -57,7 +57,7 @@ public function handle(): void $lock->block(61); EntityFacade::deleteEntityMetadataFromFolder($entity->file, $federation->xml_id); - NotificationService::sendEntityNotification($entity, EntityStateChanged::class); + NotificationService::sendEntityNotification($entity, new EntityStateChanged($entity)); if ($entity->hfd) { NotificationService::sendEntityNotification($entity, EntityDeletedFromHfd::class); } diff --git a/app/Listeners/SendUpdatedEntityToSaveJob.php b/app/Listeners/SendUpdatedEntityToSaveJob.php index 139028f..f648197 100644 --- a/app/Listeners/SendUpdatedEntityToSaveJob.php +++ b/app/Listeners/SendUpdatedEntityToSaveJob.php @@ -30,9 +30,12 @@ public function handle(UpdateEntity $event): void if ($entity->wasChanged('xml_file') ) { FolderAddEntity::dispatch($event->entity); - } elseif ($entity->approved == 1 && ! $entity->wasChanged('edugain')) { - Log::info('update some entity in SendUpdatedEntityToSaveJob'); - NotificationService::sendUpdateNotification($entity); + } elseif ($entity->approved == 1 && !$entity->wasChanged('approved') ){ + + if(!$entity->wasChanged('edugain')){ + NotificationService::sendUpdateNotification($entity); + } + } if ($entity->wasChanged('edugain')) { if ($entity->edugain == 1) {