Skip to content

Commit

Permalink
Request up to 100 projects/configs during setup
Browse files Browse the repository at this point in the history
Closes ENG-2649.
  • Loading branch information
Piccirello committed Jul 7, 2021
1 parent 260dc0a commit f68736e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ func SetWorkplaceSettings(host string, verifyTLS bool, apiKey string, values mod

// GetProjects get projects
func GetProjects(host string, verifyTLS bool, apiKey string) ([]models.ProjectInfo, Error) {
statusCode, _, response, err := GetRequest(host, verifyTLS, apiKeyHeader(apiKey), "/v3/projects", []queryParam{})
var params []queryParam
params = append(params, queryParam{Key: "per_page", Value: "100"})

statusCode, _, response, err := GetRequest(host, verifyTLS, apiKeyHeader(apiKey), "/v3/projects", params)
if err != nil {
return nil, Error{Err: err, Message: "Unable to fetch projects", Code: statusCode}
}
Expand Down Expand Up @@ -438,6 +441,7 @@ func GetEnvironment(host string, verifyTLS bool, apiKey string, project string,
func GetConfigs(host string, verifyTLS bool, apiKey string, project string) ([]models.ConfigInfo, Error) {
var params []queryParam
params = append(params, queryParam{Key: "project", Value: project})
params = append(params, queryParam{Key: "per_page", Value: "100"})

statusCode, _, response, err := GetRequest(host, verifyTLS, apiKeyHeader(apiKey), "/v3/configs", params)
if err != nil {
Expand Down

0 comments on commit f68736e

Please sign in to comment.