diff --git a/app/Observers/GroupObserver.php b/app/Observers/GroupObserver.php index 78fe9a6..29fecab 100644 --- a/app/Observers/GroupObserver.php +++ b/app/Observers/GroupObserver.php @@ -13,11 +13,7 @@ class GroupObserver { public function created(Group $group) { - if (App::isLocal()) { - return; - } - - if ($group->type === GroupTypeEnum::Team && $group->parent->nextcloud_folder_id) { + if (! App::isProduction() && $group->type === GroupTypeEnum::Team && $group->parent?->nextcloud_folder_id) { NextcloudService::createGroup($group->hashid); // Parent->name / Group->name NextcloudService::setDisplayName($group->hashid, $group->parent->name . ' / ' . $group->name); @@ -35,7 +31,7 @@ public function created(Group $group) public function updated(Group $group): void { - if (App::isLocal()) { + if (! App::isProduction()) { return; } @@ -71,7 +67,7 @@ public function updated(Group $group): void public function deleted(Group $group) { - if (App::isLocal()) { + if (! App::isProduction()) { return; } diff --git a/tests/Feature/Api/v1/GroupsTest.php b/tests/Feature/Api/v1/GroupsTest.php index d6f8415..3078656 100644 --- a/tests/Feature/Api/v1/GroupsTest.php +++ b/tests/Feature/Api/v1/GroupsTest.php @@ -175,7 +175,9 @@ }); test('Delete Group success as Owner', function () { - $group = Group::factory()->create(); + $group = Group::factory()->create([ + 'type' => GroupTypeEnum::Team, + ]); $user = Sanctum::actingAs( User::factory()->create(), diff --git a/tests/Feature/Staff/GroupMemberTest.php b/tests/Feature/Staff/GroupMemberTest.php index 4a5bf4d..4c68068 100644 --- a/tests/Feature/Staff/GroupMemberTest.php +++ b/tests/Feature/Staff/GroupMemberTest.php @@ -34,8 +34,6 @@ $this->actingAs($user, 'staff'); - var_dump(GroupUserLevel::Admin->name); - $response = patchJson( route('staff.groups.members.update', ['group' => $group, 'member' => $userToBeUpdated]), ['level' => GroupUserLevel::Admin->value],