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

Fix: add pagination for teams api #983

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

fixes #981

Solution

Added pagination for teams() api call.
Minor updates to code to add the pagination.
Updated unit tests.

@@ -233,24 +233,20 @@ type EnvironmentDeployResponse struct {
Id string `json:"id"`
}

func (Environment) getEndpoint() string {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed... I do it in a different way.

@@ -29,7 +24,7 @@ func (p *Pagination) next(currentPageSize int) bool {
}

// params - additional params. may be nil.
func getAll[P Paginated](client *ApiClient, params map[string]string) ([]P, error) {
func getAll[P any](client *ApiClient, endpoint string, params map[string]string) ([]P, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified to support all types.

client/team.go Outdated Show resolved Hide resolved
@TomerHeber
Copy link
Collaborator Author

/review

@bot-env0 bot-env0 requested a review from a team November 20, 2024 01:15
Copy link
Contributor

@razbensimon razbensimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce 👍🏼

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Nov 20, 2024
@TomerHeber TomerHeber merged commit c43e444 into main Nov 20, 2024
5 checks passed
@TomerHeber TomerHeber deleted the fix-add-team-pagination-#981 branch November 20, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client fix ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination for env0_teams data source
2 participants