Skip to content

Commit 4a1f3d4

Browse files
author
Justinas Pošiūnas
committed
fix: query parameters
1 parent 3b4d575 commit 4a1f3d4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Api/Groups.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public function getSubscribers($groupId, $type = null, $params = [])
2323
$endpoint .= '/' . $type;
2424
}
2525

26+
$params = array_merge($this->prepareParams(), $params);
27+
2628
$response = $this->restClient->get($endpoint, $params);
2729

2830
return $response['body'];

src/Api/Subscribers.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public function getGroups($subscriberId, $params = [])
1919
{
2020
$this->endpoint .= $subscriberId . '/groups';
2121

22+
$params = array_merge($this->prepareParams(), $params);
23+
2224
$response = $this->restClient->get($endpoint, $params);
2325

2426
return $response['body'];
@@ -40,6 +42,8 @@ public function getActivity($subscriberId, $type = null, $params = [])
4042
$this->endpoint .= '/' . $type;
4143
}
4244

45+
$params = array_merge($this->prepareParams(), $params);
46+
4347
$response = $this->restClient->get($endpoint, $params);
4448

4549
return $response['body'];
@@ -49,13 +53,15 @@ public function getActivity($subscriberId, $type = null, $params = [])
4953
* Seach for a subscriber by email or custom field value
5054
*
5155
* @param string $query
52-
* @return [type]
56+
* @return [type]
5357
*/
5458
public function search($query)
5559
{
5660
$this->endpoint .= '/search';
5761

58-
$response = $this->restClient->get($this->endpoint, ['query' => $query]);
62+
$params = array_merge($this->prepareParams(), ['query' => $query]);
63+
64+
$response = $this->restClient->get($this->endpoint, $params);
5965

6066
return $response['body'];
6167
}

0 commit comments

Comments
 (0)