diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index 505f307e6..896c1a79d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -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']] ); }