Skip to content

Commit

Permalink
fix detach/attach job problem
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Aug 5, 2024
1 parent d68a8ec commit 636f481
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/FederationEntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;

use App\Jobs\FolderDeleteMembership;
use App\Models\Entity;
use App\Models\Federation;
use App\Notifications\FederationMembersChanged;
Expand Down Expand Up @@ -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'));

Expand Down

0 comments on commit 636f481

Please sign in to comment.