Skip to content

Commit

Permalink
Fixes pagination (#13)
Browse files Browse the repository at this point in the history
* fixed pagination bug related to unexprected "next" field in response

* fixed pagination bug related to unexprected "next" field in response

Co-authored-by: Alexey Schetinin <a.schetinin@cloudpayments.ru>
  • Loading branch information
alexeyvs and Alexey Schetinin authored Dec 6, 2020
1 parent e0cc6dd commit 268efaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bitbucket.Cloud.Net/BitbucketCloudClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private async Task<IEnumerable<T>> GetPagedResultsAsync<T>(int? maxPages, IDicti
selectorResults.Page = Math.Max(selectorResults.Page, 1);
results.AddRange(selectorResults.Values);

isLastPage = selectorResults.Next == null;
isLastPage = selectorResults.Next == null || selectorResults.Size == numPages * selectorResults.PageLen;
if (!isLastPage)
{
queryParamValues["page"] = selectorResults.Page + 1;
Expand Down

0 comments on commit 268efaf

Please sign in to comment.