-
Notifications
You must be signed in to change notification settings - Fork 178
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: Adds pagination in mongodbatlas_team
resource & data source
#2919
Conversation
APIx bot: a message has been sent to Docs Slack channel |
mongodbatlas_team
resource & data source
mongodbatlas_team
resource & data sourcemongodbatlas_team
resource & data source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
users, _, err := connV2.TeamsApi.ListTeamUsers(ctx, orgID, team.GetId()).Execute() | ||
teamUsers, err := dsschema.AllPages(ctx, func(ctx context.Context, pageNum int) (dsschema.PaginateResponse[admin.CloudAppUser], *http.Response, error) { | ||
request := connV2.TeamsApi.ListTeamUsers(ctx, orgID, team.GetId()) | ||
request = request.PageNum(pageNum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have to provide itemsPerPage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, not required
@@ -77,21 +80,26 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag. | |||
} | |||
|
|||
if err := d.Set("team_id", team.GetId()); err != nil { | |||
return diag.FromErr(fmt.Errorf(errorTeamSetting, "name", d.Id(), err)) | |||
return diag.FromErr(fmt.Errorf(errorTeamSetting, "team_id", d.Id(), err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice spotted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
This PR fixes pagination logic whenever users in a team are retrieved in data source & resource.
Link to any related issue(s): CLOUDP-289122
#2871
Type of change:
Required Checklist:
Further comments