Skip to content

Commit

Permalink
Only run nextcloud code on production from the GroupObserver
Browse files Browse the repository at this point in the history
  • Loading branch information
HabuTheTiger committed Nov 20, 2024
1 parent dd61d18 commit 438fb53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Observers/GroupObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class GroupObserver
{
public function created(Group $group)
{
if (App::isLocal()) {
if (! App::isProduction()) {
return;
}

if ($group->type === GroupTypeEnum::Team && $group->parent->nextcloud_folder_id) {
if ($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);
Expand All @@ -34,7 +34,7 @@ public function created(Group $group)

public function updated(Group $group): void
{
if (App::isLocal()) {
if (! App::isProduction()) {
return;
}

Expand Down Expand Up @@ -70,7 +70,7 @@ public function updated(Group $group): void

public function deleted(Group $group)
{
if (App::isLocal()) {
if (! App::isProduction()) {
return;
}

Expand Down

0 comments on commit 438fb53

Please sign in to comment.