Skip to content

Commit

Permalink
fix test and commit Bus:chain
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 2, 2024
1 parent 95c9ca6 commit c8a44b7
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 60 deletions.
18 changes: 10 additions & 8 deletions app/Http/Controllers/EntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,16 @@ function () use ($entity) {
])->dispatch();*/

// TODO here M:N connection wit federation
foreach ($entity->federations as $federation) {
/* Bus::chain([
/* foreach ($entity->federations as $federation) {
Bus::chain([
new GitAddMember($federation, $entity, Auth::user()),
function () use ($federation, $entity) {
$admins = User::activeAdmins()->select('id', 'email')->get();
Notification::send($federation->operators, new FederationMemberChanged($federation, $entity, 'added'));
Notification::send($admins, new FederationMemberChanged($federation, $entity, 'added'));
},
])->dispatch();*/
}
])->dispatch();
}*/
} else {
$entity->delete();

Expand Down Expand Up @@ -435,7 +435,8 @@ function () use ($entity) {
$status = $entity->edugain ? 'edugain' : 'no_edugain';
$color = $entity->edugain ? 'green' : 'red';

if ($entity->edugain) {
// TODO add and delete from EDUGAIN
/* if ($entity->edugain) {
Bus::chain([
new GitAddToEdugain($entity, Auth::user()),
function () use ($entity) {
Expand All @@ -453,7 +454,7 @@ function () use ($entity) {
Notification::send($admins, new EntityEdugainStatusChanged($entity));
},
])->dispatch();
}
}*/

return redirect()
->back()
Expand Down Expand Up @@ -509,14 +510,15 @@ function () use ($entity) {
$entity->category()->associate($category);
$entity->save();

Bus::chain([
// TODO work with category
/* Bus::chain([
new GitDeleteFromCategory($old_category, $entity, Auth::user()),
new GitAddToCategory($category, $entity, Auth::user()),
function () use ($entity, $category) {
$admins = User::activeAdmins()->select('id', 'email')->get();
Notification::send($admins, new IdpCategoryChanged($entity, $category));
},
])->dispatch();
])->dispatch();*/

if (! $entity->wasChanged()) {
return redirect()
Expand Down
Loading

0 comments on commit c8a44b7

Please sign in to comment.