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

Commit

Permalink
Merge pull request #24 from 21TORR/language-fix
Browse files Browse the repository at this point in the history
Explicitly pass language `*` is none is given
  • Loading branch information
21christiansc authored Dec 17, 2021
2 parents 6d6501b + b88aac2 commit dc9e018
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
4.0.0-beta.8
============

* (bug) Explicitly pass language `*` is none is given.


4.0.0-beta.7
============

Expand Down
14 changes: 5 additions & 9 deletions src/Api/PrismicApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,15 @@ public function searchDocuments (

while ($page <= $maxPage)
{
$query = [
$response = $this->requestContent("documents/search", [
"ref" => $ref ?? $this->getEnvironment()->getMasterRefId(),
"q" => \implode("", $predicates),
"pageSize" => 100,
"page" => $page,
];

if (null !== $language)
{
$query["lang"] = $language;
}

$response = $this->requestContent("documents/search", $query);
"lang" => null !== $language
? $language
: "*",
]);

foreach ($response["results"] as $result)
{
Expand Down

0 comments on commit dc9e018

Please sign in to comment.