From 5f2cb8a7f1cf14cf00e0f467ec7ff100fe87cac5 Mon Sep 17 00:00:00 2001 From: bigboss Date: Tue, 14 Dec 2021 16:20:01 -0300 Subject: [PATCH] fixes --- src/Controller/Action/CitySearchAction.php | 5 ++++- src/Controller/Action/PostcodeSearchAction.php | 5 ++++- src/Controller/Action/ProductSearchAction.php | 5 ++++- src/Controller/Action/ProvinceSearchAction.php | 5 ++++- src/Controller/ReportController.php | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Controller/Action/CitySearchAction.php b/src/Controller/Action/CitySearchAction.php index 3bf0463..0dfc5ca 100644 --- a/src/Controller/Action/CitySearchAction.php +++ b/src/Controller/Action/CitySearchAction.php @@ -34,7 +34,10 @@ public function __construct( public function __invoke(Request $request): Response { - $addresses = $this->getAddresses($request->get('city', '')); + /** @var string $query */ + $query = $request->query->get('city', ''); + + $addresses = $this->getAddresses($query); $view = View::create($addresses); $this->viewHandler->setExclusionStrategyGroups(['Autocomplete']); diff --git a/src/Controller/Action/PostcodeSearchAction.php b/src/Controller/Action/PostcodeSearchAction.php index 19a5c5c..993ff85 100644 --- a/src/Controller/Action/PostcodeSearchAction.php +++ b/src/Controller/Action/PostcodeSearchAction.php @@ -34,7 +34,10 @@ public function __construct( public function __invoke(Request $request): Response { - $addresses = $this->getAddresses($request->get('postcode', '')); + /** @var string $query */ + $query = $request->query->get('postcode', ''); + + $addresses = $this->getAddresses($query); $view = View::create($addresses); $this->viewHandler->setExclusionStrategyGroups(['Autocomplete']); diff --git a/src/Controller/Action/ProductSearchAction.php b/src/Controller/Action/ProductSearchAction.php index c470be8..ca17414 100644 --- a/src/Controller/Action/ProductSearchAction.php +++ b/src/Controller/Action/ProductSearchAction.php @@ -35,7 +35,10 @@ public function __invoke(Request $request): Response { $locale = $this->localeContext->getLocaleCode(); - $products = $this->getProducts($request->get('name', ''), $locale); + /** @var string $query */ + $query = $request->query->get('name', ''); + + $products = $this->getProducts($query, $locale); $view = View::create($products); $this->viewHandler->setExclusionStrategyGroups(['Autocomplete']); diff --git a/src/Controller/Action/ProvinceSearchAction.php b/src/Controller/Action/ProvinceSearchAction.php index 74feb19..74a377d 100644 --- a/src/Controller/Action/ProvinceSearchAction.php +++ b/src/Controller/Action/ProvinceSearchAction.php @@ -38,7 +38,10 @@ public function __construct( public function __invoke(Request $request): Response { - $addresses = $this->getAddresses($request->get('province', '')); + /** @var string $query */ + $query = $request->query->get('province', ''); + + $addresses = $this->getAddresses($query); $view = View::create($addresses); $this->viewHandler->setExclusionStrategyGroups(['Autocomplete']); diff --git a/src/Controller/ReportController.php b/src/Controller/ReportController.php index d287db2..28fdff6 100644 --- a/src/Controller/ReportController.php +++ b/src/Controller/ReportController.php @@ -69,7 +69,7 @@ public function exportAction(Request $request): Response $filename = $this->slugify($report->getName()); - $format = $request->get('_format'); + $format = $request->query->get('_format'); switch ($format) { case 'json': $response = $this->createJsonResponse($filename, $data);