From 3fce131aae8e41579efabc399e3e63d0c49e6641 Mon Sep 17 00:00:00 2001 From: Toma Puljak Date: Mon, 13 Jan 2025 16:30:52 +0000 Subject: [PATCH] fix: PR list pagination Signed-off-by: Toma Puljak --- pkg/cmd/workspace/util/branch_wizard.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/workspace/util/branch_wizard.go b/pkg/cmd/workspace/util/branch_wizard.go index d7e5d65efb..4c0a26c958 100644 --- a/pkg/cmd/workspace/util/branch_wizard.go +++ b/pkg/cmd/workspace/util/branch_wizard.go @@ -179,16 +179,17 @@ func SetBranchFromWizard(config BranchWizardConfig) (*apiclient.GitRepository, e curPageItemsNum := 0 selectionListCursorIdx := 0 var selectionListOptions views.SelectionListOptions + prList = []apiclient.GitPullRequest{} for { err = views_util.WithSpinner("Loading Pull Requests", func() error { - branches, _, err := config.ApiClient.GitProviderAPI.GetRepoBranches(ctx, config.GitProviderConfigId, url.QueryEscape(config.NamespaceId), url.QueryEscape(config.ChosenRepo.Id)).Page(page).PerPage(perPage).Execute() + prs, _, err := config.ApiClient.GitProviderAPI.GetRepoPRs(ctx, config.GitProviderConfigId, url.QueryEscape(config.NamespaceId), url.QueryEscape(config.ChosenRepo.Id)).Page(page).PerPage(perPage).Execute() if err != nil { return err } - curPageItemsNum = len(branches) - branchList = append(branchList, branches...) + curPageItemsNum = len(prs) + prList = append(prList, prs...) return nil })