feat: searchable contacts on introductions form (#5632)

This commit is contained in:
Stefan Linke
2021-10-26 23:07:45 +02:00
committed by GitHub
parent 77ba876e53
commit cc05552320
4 changed files with 89 additions and 15 deletions
@@ -7,6 +7,7 @@ use App\Models\Contact\Contact;
use App\Http\Controllers\Controller;
use App\Traits\JsonRespondController;
use App\Services\Contact\Contact\UpdateContactIntroduction;
use App\Http\Resources\Contact\ContactShort as ContactResource;
class IntroductionsController extends Controller
{
@@ -25,11 +26,17 @@ class IntroductionsController extends Controller
$contacts = $contact->siblingContacts()
->real()
->active()
->get();
->paginate(20);
$introducer = $contact->getIntroducer();
if ($introducer !== null) {
$introducer = new ContactResource($introducer);
}
return view('people.introductions.edit')
->withContact($contact)
->withContacts($contacts);
->withContacts(ContactResource::collection($contacts))
->withIntroducer($introducer);
}
/**