Skip to content

Commit

Permalink
fix bug with second update
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 22, 2024
1 parent aa68ba6 commit 8ef930e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Observers/EntityObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
use App\Jobs\FolderDeleteEntity;
use App\Models\Entity;
use App\Services\NotificationService;
use Illuminate\Contracts\Events\ShouldHandleEventsAfterCommit;

class EntityObserver
class EntityObserver implements ShouldHandleEventsAfterCommit
{
/**
* Handle the Entity "created" event.
Expand All @@ -29,7 +30,7 @@ public function updated(Entity $entity): void
FolderAddEntity::dispatch($entity);
} elseif ($entity->approved == 1 && !$entity->wasChanged('approved') ){

if(!$entity->wasChanged('edugain')){
if(!$entity->wasChanged('edugain') && !$entity->wasChanged('deleted_at')){
NotificationService::sendUpdateNotification($entity);
}

Expand Down

0 comments on commit 8ef930e

Please sign in to comment.