1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Adjust invitation controller to deal with deleted contacts

This commit is contained in:
David Bomba 2022-01-13 15:10:43 +11:00
parent 8f2f6f93ea
commit 37d6701780
2 changed files with 5 additions and 1 deletions

View File

@ -87,6 +87,10 @@ class InvitationController extends Controller
if(!$invitation) if(!$invitation)
return abort(404,'The resource is no longer available.'); return abort(404,'The resource is no longer available.');
/* 12/01/2022 Clean up an edge case where if the contact is trashed, restore if a invitation comes back. */
if($invitation->contact->trashed())
$invitation->contact->restore();
/* Return early if we have the correct client_hash embedded */ /* Return early if we have the correct client_hash embedded */
$client_contact = $invitation->contact; $client_contact = $invitation->contact;

View File

@ -34,7 +34,7 @@ class CheckClientExistence
->where('email', auth('contact')->user()->email) ->where('email', auth('contact')->user()->email)
->whereNotNull('email') ->whereNotNull('email')
->where('email', '<>', '') ->where('email', '<>', '')
->whereNull('deleted_at') // ->whereNull('deleted_at')
->distinct('company_id') ->distinct('company_id')
->distinct('email') ->distinct('email')
->whereNotNull('company_id') ->whereNotNull('company_id')