From 1e99ca2ca5ca94de53e6431e1f3be9fdcef115fe Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 13 Dec 2021 09:41:27 +0100 Subject: [PATCH] fix: add availableForUsers condition from locationType in the location API endpoint --- .../ChillMainBundle/Controller/LocationApiController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php index 525475e3c..aa5f46f1a 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php @@ -21,11 +21,14 @@ class LocationApiController extends ApiController { public function customizeQuery(string $action, Request $request, $query): void { - $query->andWhere( - $query->expr()->andX( + $query + ->leftJoin('e.locationType', 'lt') + ->andWhere( + $query->expr()->andX( $query->expr()->eq('e.availableForUsers', "'TRUE'"), + $query->expr()->eq('lt.availableForUsers', "'TRUE'"), $query->expr()->eq('e.active', "'TRUE'"), ) - ); + ); } }