Skip to content

Commit

Permalink
do not ->toArray on null federation object
Browse files Browse the repository at this point in the history
  • Loading branch information
irevoire committed Aug 1, 2024
1 parent 47ffe4b commit fe7d6a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Endpoints/Delegates/HandlesMultiSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function multiSearch(array $queries = [], ?MultiSearchFederation $federat
$body[] = $query->toArray();
}

return $this->http->post('/multi-search', ['queries' => $body, 'federation' => $federation->toArray()]);
$payload = ['queries' => $body];
if ($federation !== null) {
$payload['federation'] = $federation->toArray();
}
return $this->http->post('/multi-search', $payload);
}
}

0 comments on commit fe7d6a2

Please sign in to comment.