From e52880bb532f1612e414ffbb227d2c783946d952 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 3 Nov 2021 10:27:58 +0100 Subject: [PATCH] location: filter location-type by active and availableForUsers --- .../Controller/LocationTypeApiController.php | 25 +++++++++++++++++++ .../ChillMainExtension.php | 1 + 2 files changed, 26 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php diff --git a/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php b/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php new file mode 100644 index 000000000..2a3a6cc59 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php @@ -0,0 +1,25 @@ +andWhere( + $query->expr()->andX( + $query->expr()->eq('e.availableForUsers', "'TRUE'"), + $query->expr()->eq('e.active', "'TRUE'"), + ) + ); + } +} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 7b2f0a3a1..b35ca5004 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -526,6 +526,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface, ], [ 'class' => \Chill\MainBundle\Entity\LocationType::class, + 'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class, 'name' => 'location_type', 'base_path' => '/api/1.0/main/location-type', 'base_role' => 'ROLE_USER',