From 636f481b6683ce2e6c30504065ad2d353e7d787e Mon Sep 17 00:00:00 2001 From: Artem Otliaguzov Date: Mon, 5 Aug 2024 12:24:09 +0200 Subject: [PATCH] fix detach/attach job problem --- app/Http/Controllers/FederationEntityController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Controllers/FederationEntityController.php b/app/Http/Controllers/FederationEntityController.php index 6877c9b..dd814d8 100644 --- a/app/Http/Controllers/FederationEntityController.php +++ b/app/Http/Controllers/FederationEntityController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Jobs\FolderDeleteMembership; use App\Models\Entity; use App\Models\Federation; use App\Notifications\FederationMembersChanged; @@ -75,6 +76,11 @@ public function destroy(Federation $federation) $federation->entities()->detach(request('entities')); + foreach (request('entities') as $id) { + $entity = Entity::find($id); + FolderDeleteMembership::dispatch($entity, $federation); + } + $old_entities = Entity::whereIn('id', request('entities'))->get(); NotificationService::sendModelNotification($federation, new FederationMembersChanged($federation, $old_entities, 'deleted'));