1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01: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)
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 */
$client_contact = $invitation->contact;

View File

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