diff --git a/app/Jobs/Util/WebhookSingle.php b/app/Jobs/Util/WebhookSingle.php index c463071d0052..51a87d7e3290 100644 --- a/app/Jobs/Util/WebhookSingle.php +++ b/app/Jobs/Util/WebhookSingle.php @@ -75,16 +75,10 @@ class WebhookSingle implements ShouldQueue MultiDB::setDb($this->db); $subscription = Webhook::query()->with('company')->find($this->subscription_id); - - if ($subscription) { - // nlog("firing event ID {$subscription->event_id} company_id {$subscription->company_id}"); - } - + if (!$subscription) { $this->fail(); - nlog("failed to fire event, could not find webhook ID {$this->subscription_id}"); - return; } @@ -185,7 +179,6 @@ class WebhookSingle implements ShouldQueue $this->fail(); return; } - $this->release($this->backoff()[$this->attempts()-1]); } diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index 73bde51b2b44..e9f566b06835 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -278,7 +278,7 @@ class BaseModel extends Model ->exists(); if ($subscriptions) { - WebhookHandler::dispatch($event_id, $this, $this->company, $additional_data); + WebhookHandler::dispatch($event_id, $this->withoutRelations(), $this->company, $additional_data); } } diff --git a/app/Services/Invoice/MarkSent.php b/app/Services/Invoice/MarkSent.php index dc6af4a65659..c4d07dc037bb 100644 --- a/app/Services/Invoice/MarkSent.php +++ b/app/Services/Invoice/MarkSent.php @@ -55,9 +55,6 @@ class MarkSent extends AbstractService ->setReminder() ->save(); - /*Adjust client balance*/ - // $this->invoice->client->service()->updateBalance($adjustment)->save(); - $this->invoice->markInvitationsSent(); event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));