mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
filter out active centers in api
This commit is contained in:
parent
9600543fec
commit
4d111cd6cf
@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
@ -52,11 +53,13 @@ class PersonApiController extends ApiController
|
||||
{
|
||||
$centers = $this->authorizedCenterOnPersonCreation->getCenters();
|
||||
|
||||
$centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive());
|
||||
|
||||
return $this->json(
|
||||
['showCenters' => $this->showCenters, 'centers' => $centers],
|
||||
['showCenters' => $this->showCenters, 'centers' => $centersActive],
|
||||
Response::HTTP_OK,
|
||||
[],
|
||||
['gropus' => ['read']]
|
||||
['groups' => ['read']]
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user