{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/cli/issues/627","labels_url":"https://api.github.com/repos/cloudfoundry/cli/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/cli/issues/627/comments","events_url":"https://api.github.com/repos/cloudfoundry/cli/issues/627/events","html_url":"https://github.com/cloudfoundry/cli/pull/627","id":111294469,"number":627,"title":"Add the type field to 'cf domains' command.","user":{"login":"mdelillo","id":6590106,"avatar_url":"https://avatars.githubusercontent.com/u/6590106?v=3","gravatar_id":"","url":"https://api.github.com/users/mdelillo","html_url":"https://github.com/mdelillo","followers_url":"https://api.github.com/users/mdelillo/followers","following_url":"https://api.github.com/users/mdelillo/following{/other_user}","gists_url":"https://api.github.com/users/mdelillo/gists{/gist_id}","starred_url":"https://api.github.com/users/mdelillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdelillo/subscriptions","organizations_url":"https://api.github.com/users/mdelillo/orgs","repos_url":"https://api.github.com/users/mdelillo/repos","events_url":"https://api.github.com/users/mdelillo/events{/privacy}","received_events_url":"https://api.github.com/users/mdelillo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-13T23:44:20Z","updated_at":"2015-10-29T00:53:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cloudfoundry/cli/pulls/627","html_url":"https://github.com/cloudfoundry/cli/pull/627","diff_url":"https://github.com/cloudfoundry/cli/pull/627.diff","patch_url":"https://github.com/cloudfoundry/cli/pull/627.patch"},"body":"This displays the type of router group for domains associated with router groups.\r\n\r\nBelow is the story in the routing team's tracker:\r\nhttps://www.pivotaltracker.com/story/show/100981770"},"comment":{"url":"https://api.github.com/repos/cloudfoundry/cli/issues/comments/152043107","html_url":"https://github.com/cloudfoundry/cli/pull/627#issuecomment-152043107","issue_url":"https://api.github.com/repos/cloudfoundry/cli/issues/627","id":152043107,"user":{"login":"yuzhangcmu","id":5315373,"avatar_url":"https://avatars.githubusercontent.com/u/5315373?v=3","gravatar_id":"","url":"https://api.github.com/users/yuzhangcmu","html_url":"https://github.com/yuzhangcmu","followers_url":"https://api.github.com/users/yuzhangcmu/followers","following_url":"https://api.github.com/users/yuzhangcmu/following{/other_user}","gists_url":"https://api.github.com/users/yuzhangcmu/gists{/gist_id}","starred_url":"https://api.github.com/users/yuzhangcmu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuzhangcmu/subscriptions","organizations_url":"https://api.github.com/users/yuzhangcmu/orgs","repos_url":"https://api.github.com/users/yuzhangcmu/repos","events_url":"https://api.github.com/users/yuzhangcmu/events{/privacy}","received_events_url":"https://api.github.com/users/yuzhangcmu/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T00:53:15Z","updated_at":"2015-10-29T00:53:15Z","body":"@krishicks:\r\nI and @mdelillo refactored the code as your comment:\r\n1. Rebased the master branch as there is some test error if don't rebase.\r\n2. Instead put routerGroupsMap as a field of struct, just pass it as a parameter. Why we don't  populating routerGroupsMap in the function locally because if there is not any domain has RoutergroupGuid, then we don't need to populate it. So we only populate it when necessary. And we make a function to do it to separate the logic. That is one function do only one thing.\r\n3. A test which says it returns an error regarding an invalid router group guid was actually asserting the response was \"Failed fetching router groups\".\r\n-- We changed the test case and the code to display the right information. \r\n\r\nThanks.\r\n\r\n@mdelillo  @yuzhangcmu"}}