From 209cca4a7ea559451b37f0d26427998ac2e19241 Mon Sep 17 00:00:00 2001 From: jmcollin Date: Wed, 17 Apr 2024 17:22:56 +0200 Subject: [PATCH] fix: query params to generate the query --- src/Clients/GenericClient.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Clients/GenericClient.php b/src/Clients/GenericClient.php index 3a6bc6d..79c1168 100644 --- a/src/Clients/GenericClient.php +++ b/src/Clients/GenericClient.php @@ -208,7 +208,7 @@ protected function setRoute($route) { $this->route = $route; if ($this->getQueryParameters()) { - $this->route .= $this->getQueryParameters(); + $this->route .= '?' . http_build_query($this->getQueryParameters()); } return $this; @@ -249,14 +249,13 @@ protected function setApiVersion($apiVersion) */ protected function setQueryParams(array $params) { - $this->queryParameters = []; $notAllowedParameters = array_diff_key($params, array_flip($this->possibleQueryParameters)); if (!empty($notAllowedParameters)) { throw new QueryParamsException($notAllowedParameters, $this->possibleQueryParameters); } $filteredParams = array_intersect_key($params, array_flip($this->possibleQueryParameters)); - $this->queryParameters = '?' . http_build_query(array_merge($this->queryParameters, $filteredParams)); + $this->queryParameters = array_merge($this->queryParameters, $filteredParams); return $this; }