mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Evaluate if the event properties exists before run the CheckoutAcceptance query
This commit is contained in:
parent
3cf9c1fea5
commit
439e031911
|
@ -79,8 +79,9 @@ class CheckoutableListener
|
||||||
/**
|
/**
|
||||||
* Send the appropriate notification
|
* Send the appropriate notification
|
||||||
*/
|
*/
|
||||||
$acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id ?? null)
|
if ($event->checkedOutTo && $event->checkoutable){
|
||||||
->where('assigned_to_id', $event->checkedOutTo->id ?? null)
|
$acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
|
||||||
|
->where('assigned_to_id', $event->checkedOutTo->id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach($acceptances as $acceptance){
|
foreach($acceptances as $acceptance){
|
||||||
|
@ -88,6 +89,7 @@ class CheckoutableListener
|
||||||
$acceptance->delete();
|
$acceptance->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($this->shouldSendWebhookNotification()) {
|
if ($this->shouldSendWebhookNotification()) {
|
||||||
|
|
Loading…
Reference in a new issue