Skip to content

Commit

Permalink
fix: query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Justinas Pošiūnas committed Jun 22, 2016
1 parent 3b4d575 commit 4a1f3d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Api/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function getSubscribers($groupId, $type = null, $params = [])
$endpoint .= '/' . $type;
}

$params = array_merge($this->prepareParams(), $params);

$response = $this->restClient->get($endpoint, $params);

return $response['body'];
Expand Down
10 changes: 8 additions & 2 deletions src/Api/Subscribers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public function getGroups($subscriberId, $params = [])
{
$this->endpoint .= $subscriberId . '/groups';

$params = array_merge($this->prepareParams(), $params);

$response = $this->restClient->get($endpoint, $params);

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

$params = array_merge($this->prepareParams(), $params);

$response = $this->restClient->get($endpoint, $params);

return $response['body'];
Expand All @@ -49,13 +53,15 @@ public function getActivity($subscriberId, $type = null, $params = [])
* Seach for a subscriber by email or custom field value
*
* @param string $query
* @return [type]
* @return [type]
*/
public function search($query)
{
$this->endpoint .= '/search';

$response = $this->restClient->get($this->endpoint, ['query' => $query]);
$params = array_merge($this->prepareParams(), ['query' => $query]);

$response = $this->restClient->get($this->endpoint, $params);

return $response['body'];
}
Expand Down

0 comments on commit 4a1f3d4

Please sign in to comment.