Skip to content

Commit

Permalink
Merge branch 'alphagov-empty-username-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
cdelashmutt-pivotal committed Feb 9, 2018
2 parents ff59397 + 5e73f99 commit 2678906
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apihelper/apihelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ func (api *APIHelper) GetSpace(cli plugin.CliConnection, spaceURL string) (Space
}

type Organization struct {
Name string
URL string
ManagersURL string
Name string
URL string
ManagersURL string
}

//GetOrganization returns a struct that represents critical fields in the JSON
Expand All @@ -183,8 +183,8 @@ func (api *APIHelper) GetOrganization(cli plugin.CliConnection, organizationURL
metadata := theJSON["metadata"].(map[string]interface{})

organization := Organization{
Name: entity["name"].(string),
URL: metadata["url"].(string),
Name: entity["name"].(string),
URL: metadata["url"].(string),
ManagersURL: entity["managers_url"].(string),
}

Expand All @@ -198,8 +198,9 @@ type OrgManager struct {
//GetOrgManagers returns critical fields from the returned JSON
func (api *APIHelper) GetOrgManagers(cli plugin.CliConnection, orgManagersURL string) ([]OrgManager, error) {
orgmanagers, err := processPagedResults(cli, orgManagersURL, func(metadata map[string]interface{}, entity map[string]interface{}) interface{} {
username, _ := entity["username"].(string)
return OrgManager{
UserName: entity["username"].(string),
UserName: username,
}
})

Expand Down

0 comments on commit 2678906

Please sign in to comment.