Skip to content

Commit

Permalink
Fixes for subs v1 + setting guard on repo activities
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Aug 14, 2024
1 parent f938f37 commit 40ecb6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/Livewire/BillingPortalPurchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ protected function getPaymentMethods(ClientContact $contact): self
}

if ((int)$this->price == 0) {

$this->steps['payment_required'] = false;
$this->steps['fetched_payment_methods'] = false;
$this->heading_text = ctrans('texts.payment_methods');
return $this;
} else {
// $this->steps['fetched_payment_methods'] = true;
}
Expand Down
6 changes: 3 additions & 3 deletions app/Repositories/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function archive($entity)
$className = $this->getEventClass($entity, 'Archived');

if (class_exists($className)) {
event(new $className($entity, $entity->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
event(new $className($entity, $entity->company, Ninja::eventVars(auth()->guard('api')->user() ? auth()->guard('api')->user()->id : null)));
}
}

Expand All @@ -84,7 +84,7 @@ public function restore($entity)
$className = $this->getEventClass($entity, 'Restored');

if (class_exists($className)) {
event(new $className($entity, $fromDeleted, $entity->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
event(new $className($entity, $fromDeleted, $entity->company, Ninja::eventVars(auth()->guard('api')->user() ? auth()->guard('api')->user()->id : null)));
}
}

Expand All @@ -105,7 +105,7 @@ public function delete($entity)
$className = $this->getEventClass($entity, 'Deleted');

if (class_exists($className) && !($entity instanceof Company)) {
event(new $className($entity, $entity->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
event(new $className($entity, $entity->company, Ninja::eventVars(auth()->guard('api')->user() ? auth()->guard('api')->user()->id : null)));
}
}

Expand Down

0 comments on commit 40ecb6a

Please sign in to comment.