Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Fix ApiList component when there's no api.preferred returned from api
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Dec 5, 2017
1 parent db09dfa commit eab0286
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 32 deletions.
3 changes: 2 additions & 1 deletion example/src/ApiList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ class ApiList extends React.Component {
<select onChange={this.changeApi} value={this.state.selected}>
{ Object.keys(this.state.apis).map((name) => {
const api = this.state.apis[name];
const preferred = api.preferred || Object.keys(api.versions)[0];
return (
<option value={api.versions[api.preferred].swaggerUrl} key={name}>
<option value={api.versions[preferred].swaggerUrl} key={name}>
{name.substring(0, 30)}
</option>
);
Expand Down
62 changes: 31 additions & 31 deletions packages/api-explorer-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eab0286

Please sign in to comment.