1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 06:32:40 +01:00

Fixes for webhook logic

This commit is contained in:
David Bomba 2023-11-10 12:36:27 +11:00
parent 3ce689a53e
commit 526b899d28
3 changed files with 2 additions and 12 deletions

View File

@ -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]);
}

View File

@ -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);
}
}

View File

@ -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)));