Skip to content

Commit

Permalink
fixed pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aldevv committed Jan 15, 2025
1 parent e942566 commit a83053c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/connector/gitlab/groups_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
gitlabSDK "gitlab.com/gitlab-org/api/client-go"
)

func (o *Client) ListGroups(ctx context.Context, nextPageStr string) ([]*gitlabSDK.Group, *gitlabSDK.Response, error) {
func (o *Client) ListGroups(ctx context.Context) ([]*gitlabSDK.Group, *gitlabSDK.Response, error) {
groups, res, err := o.Groups.ListGroups(&gitlabSDK.ListGroupsOptions{
ListOptions: gitlabSDK.ListOptions{},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/gitlab/projects_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
gitlabSDK "gitlab.com/gitlab-org/api/client-go"
)

func (o *Client) ListProjects(ctx context.Context, groupId, nextPageStr string) ([]*gitlabSDK.Project, *gitlabSDK.Response, error) {
func (o *Client) ListProjects(ctx context.Context, groupId string) ([]*gitlabSDK.Project, *gitlabSDK.Response, error) {
projects, res, err := o.Groups.ListGroupProjects(groupId, &gitlabSDK.ListGroupProjectsOptions{
ListOptions: gitlabSDK.ListOptions{},
},
Expand Down
5 changes: 1 addition & 4 deletions pkg/connector/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ func (o *groupBuilder) List(ctx context.Context, parentResourceID *v2.ResourceId
var err error

if pToken.Token == "" {
groups, res, err = o.ListGroups(ctx, pToken.Token)
if err != nil {
return nil, "", nil, err
}
groups, res, err = o.ListGroups(ctx)
} else {
groups, res, err = o.ListGroupsPaginate(ctx, pToken.Token)
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/connector/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ func (o *projectBuilder) List(ctx context.Context, parentResourceID *v2.Resource
var err error

if pToken.Token == "" {
projects, res, err = o.ListProjects(ctx, parentResourceID.Resource, pToken.Token)
if err != nil {
return nil, "", nil, err
}
projects, res, err = o.ListProjects(ctx, parentResourceID.Resource)
} else {
projects, res, err = o.ListProjectsPaginate(ctx, parentResourceID.Resource, pToken.Token)
}
Expand Down

0 comments on commit a83053c

Please sign in to comment.