Skip to content

Commit

Permalink
fix notification
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 19, 2024
1 parent cb3d302 commit 32e3d30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Jobs/FolderDeleteEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 6 additions & 3 deletions app/Listeners/SendUpdatedEntityToSaveJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 32e3d30

Please sign in to comment.