fix getFullList batch bug

This commit is contained in:
Jonathan Martz
2024-11-14 15:50:04 +00:00
parent 3baeeeab00
commit ad593198b0

View File

@@ -91,12 +91,14 @@ class Collection
* @param array $queryParams
* @return array
*/
public function getFullList(int $batch = 200, array $queryParams = []): array
public function getFullList(array $queryParams, int $batch = 200): array
{
$queryParams = [... $queryParams, ['perPage' => $batch]];
$queryParams = [... $queryParams, 'perPage'=> $batch];
$getParams = !empty($queryParams) ? http_build_query($queryParams) : "";
$response = $this->doRequest($this->url . "/api/collections/" . $this->collection . "/records?" . $getParams, 'GET');
var_dump($response);
return json_decode($response, JSON_FORCE_OBJECT);
}