{"action":"closed","issue":{"url":"https://api.github.com/repos/enquirer/prompt-list/issues/7","repository_url":"https://api.github.com/repos/enquirer/prompt-list","labels_url":"https://api.github.com/repos/enquirer/prompt-list/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/enquirer/prompt-list/issues/7/comments","events_url":"https://api.github.com/repos/enquirer/prompt-list/issues/7/events","html_url":"https://github.com/enquirer/prompt-list/issues/7","id":328716195,"node_id":"MDU6SXNzdWUzMjg3MTYxOTU=","number":7,"title":"Object with id and name as an option","user":{"login":"kfrajtak","id":1510452,"node_id":"MDQ6VXNlcjE1MTA0NTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1510452?v=4","gravatar_id":"","url":"https://api.github.com/users/kfrajtak","html_url":"https://github.com/kfrajtak","followers_url":"https://api.github.com/users/kfrajtak/followers","following_url":"https://api.github.com/users/kfrajtak/following{/other_user}","gists_url":"https://api.github.com/users/kfrajtak/gists{/gist_id}","starred_url":"https://api.github.com/users/kfrajtak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfrajtak/subscriptions","organizations_url":"https://api.github.com/users/kfrajtak/orgs","repos_url":"https://api.github.com/users/kfrajtak/repos","events_url":"https://api.github.com/users/kfrajtak/events{/privacy}","received_events_url":"https://api.github.com/users/kfrajtak/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-02T05:41:43Z","updated_at":"2018-06-04T15:53:41Z","closed_at":"2018-06-04T15:53:40Z","author_association":"NONE","body":"Hi,\r\n\r\nI've been using this excellent package in my project. I have noticed that when an item is selected then it is the `name` of the item that is returned. I have to then iterate my data source to find the item with the name selected to get the id that can be used later (kind of SELECT and OPTION HTML elements).\r\n\r\n```\r\nasync chooseCourse(enquirer) {\r\n  const courses = await this.getCourses();\r\n  const choices = [...courses].map(o => {\r\n    return {\r\n      name: o.text,\r\n      id: o.value\r\n    };\r\n  });\r\n\r\n  var questions = [\r\n    {\r\n      type: \"list\",\r\n      name: \"action\",\r\n      message: \"Choose a course ...\",\r\n      choices\r\n    }\r\n  ];\r\n\r\n  const answer = await enquirer.ask(questions);\r\n  const selectedCourse = _.find(choices, i => i.name == answer.action); // find the course\r\n\r\n  await this.selectCourse(selectedCourse.id); // use the id\r\n}\r\n```\r\n\r\nIs there a way how to force enquirer to return the whole object or this is not how it was designed and how it works?\r\n\r\nThanks,\r\nKarel\r\n"}}
{"actor":{"display_login":"doowb"}}