fix: fix contact missing create form (#2468)
This commit is contained in:
@@ -151,23 +151,37 @@ class ContactsController extends Controller
|
||||
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return $this->createForm(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form in case the contact is missing.
|
||||
*
|
||||
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function missing()
|
||||
{
|
||||
return $this->createForm(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Add user form unless the contact has limitations.
|
||||
*
|
||||
* @param bool $isContactMissing
|
||||
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
private function createForm($isContactMissing = false)
|
||||
{
|
||||
if (auth()->user()->account->hasReachedContactLimit()
|
||||
&& auth()->user()->account->hasLimitations()
|
||||
&& ! auth()->user()->account->legacy_free_plan_unlimited_contacts) {
|
||||
&& auth()->user()->account->hasLimitations()
|
||||
&& ! auth()->user()->account->legacy_free_plan_unlimited_contacts) {
|
||||
return redirect()->route('settings.subscriptions.index');
|
||||
}
|
||||
|
||||
$data = [
|
||||
'genders' => auth()->user()->account->genders,
|
||||
];
|
||||
|
||||
return view('people.create', $data);
|
||||
}
|
||||
|
||||
public function missing()
|
||||
{
|
||||
return view('people.missing');
|
||||
return view('people.create')
|
||||
->withIsContactMissing($isContactMissing)
|
||||
->withGenders(auth()->user()->account->genders);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user