From 0439e6a821c676e83ed43d9b1837108abd22cd5d Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 3 Nov 2021 09:59:40 +0100 Subject: [PATCH] location: filter location endpoint by NULL names --- .../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 5c0301959..c21eaaf26 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php @@ -22,12 +22,15 @@ class LocationApiController extends ApiController ), $query->expr()->andX( $query->expr()->eq('e.availableForUsers', "'TRUE'"), - $query->expr()->eq('e.active', "'TRUE'") + $query->expr()->eq('e.active', "'TRUE'"), + $query->expr()->isNotNull('e.name'), + $query->expr()->neq('e.name', ':emptyString'), ) )) ->setParameters([ 'user' => $this->getUser(), - 'dateBefore' => (new \DateTime())->sub(new \DateInterval('P6M')) + 'dateBefore' => (new \DateTime())->sub(new \DateInterval('P6M')), + 'emptyString' => '', ]); } -} +} \ No newline at end of file