Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #239 from seregazhuk/develop
Browse files Browse the repository at this point in the history
fix: search
  • Loading branch information
seregazhuk authored Jan 24, 2017
2 parents 94a6813 + 9650986 commit f5151f2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## [5.2.2] - 2017-01-24
### Fixed:
- Search method correctly works with limits.

## [5.2.1] - 2017-01-22
### Fixed:
- Pinners *followers()* methods.
Expand Down
16 changes: 14 additions & 2 deletions src/Api/SearchResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ class SearchResponse extends Response
{
protected function getRawBookmarksData()
{
return $this->getData('module.tree.resource.options.bookmarks', []);
// First response is special and returns bookmarks in 'module.tree` array
$bookmarks = $this->getData('module.tree.resource.options.bookmarks', []);

// All the next responses look as expected
return empty($bookmarks) ?
parent::getRawBookmarksData() :
$bookmarks;
}

/**
Expand All @@ -15,6 +21,12 @@ protected function getRawBookmarksData()
*/
public function getResponseData($key = null)
{
return $this->getData('module.tree.data.results', []);
// First response is special and returns data in 'module.tree` array
$data = $this->getData('module.tree.data.results', []);

// All the next responses look as expected
return empty($data) ?
parent::getResponseData() :
$data;
}
}

0 comments on commit f5151f2

Please sign in to comment.