Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing pagination in CustomersEndpoint getCustomers() #51

Open
gbsnj opened this issue Nov 24, 2021 · 0 comments · May be fixed by #52
Open

missing pagination in CustomersEndpoint getCustomers() #51

gbsnj opened this issue Nov 24, 2021 · 0 comments · May be fixed by #52

Comments

@gbsnj
Copy link

gbsnj commented Nov 24, 2021

missing pagination signature and implementation in getCustomers() results in not getting all customers.

Function should look like:

public function getCustomers($page = 1, $pageSize = 50, \DateTime $minCreatedAt = null)
{
$query = [
'page' => max(1, $page),
'pageSize' => max(1, $pageSize),
];

if ($minCreatedAt !== null && $minCreatedAt instanceof \DateTime) {
    $query['minCreatedAt'] = $minCreatedAt->format('c');
}
return $this->client->get(
    'customers',
    $query,
    Response\GetCustomersResponse::class
);

}

@devtronic devtronic linked a pull request Jan 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant