mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 21:04:35 -04:00
Fixes for webhook logic
This commit is contained in:
parent
3ce689a53e
commit
526b899d28
@ -75,16 +75,10 @@ class WebhookSingle implements ShouldQueue
|
|||||||
MultiDB::setDb($this->db);
|
MultiDB::setDb($this->db);
|
||||||
|
|
||||||
$subscription = Webhook::query()->with('company')->find($this->subscription_id);
|
$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) {
|
if (!$subscription) {
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
|
||||||
nlog("failed to fire event, could not find webhook ID {$this->subscription_id}");
|
nlog("failed to fire event, could not find webhook ID {$this->subscription_id}");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +179,6 @@ class WebhookSingle implements ShouldQueue
|
|||||||
$this->fail();
|
$this->fail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->release($this->backoff()[$this->attempts()-1]);
|
$this->release($this->backoff()[$this->attempts()-1]);
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ class BaseModel extends Model
|
|||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
WebhookHandler::dispatch($event_id, $this, $this->company, $additional_data);
|
WebhookHandler::dispatch($event_id, $this->withoutRelations(), $this->company, $additional_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,9 +55,6 @@ class MarkSent extends AbstractService
|
|||||||
->setReminder()
|
->setReminder()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
/*Adjust client balance*/
|
|
||||||
// $this->invoice->client->service()->updateBalance($adjustment)->save();
|
|
||||||
|
|
||||||
$this->invoice->markInvitationsSent();
|
$this->invoice->markInvitationsSent();
|
||||||
|
|
||||||
event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user