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

Commit

Permalink
Fix test and prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcuva committed Dec 7, 2018
1 parent a06db4a commit 52042e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions packages/api-explorer/src/Doc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ class Doc extends React.Component {
<div className="hub-reference-results tabber-parent">{this.renderResponse()}</div>
</div>
)}
<div className="hub-reference-right switcher">{this.renderResponseSchema('dark')}</div>
<div className="hub-reference-right switcher">
{this.renderResponseSchema('dark')}
</div>
<Content body={doc.body} flags={this.props.flags} isThreeColumn="right" />
</div>
</Fragment>
Expand Down Expand Up @@ -228,7 +230,12 @@ class Doc extends React.Component {
renderResponseSchema(theme = 'light') {
const operation = this.getOperation();

return operation.responses && <ResponseSchema theme={theme} operation={this.getOperation()} oas={this.oas} />;
return (
operation &&
operation.responses && (
<ResponseSchema theme={theme} operation={this.getOperation()} oas={this.oas} />
)
);
}

renderEndpoint() {
Expand Down
7 changes: 6 additions & 1 deletion packages/api-explorer/src/ResponseSchema.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ class ResponseSchema extends React.Component {
if (!operation.responses || Object.keys(operation.responses).length === 0) return null;
const schema = this.getSchema(operation);
return (
<div className={classNames({"hub-reference-response-definitions": true, 'dark': this.props.theme === 'dark' })}>
<div
className={classNames({
'hub-reference-response-definitions': true,
dark: this.props.theme === 'dark',
})}
>
{this.renderHeader()}
<div className="response-schema">
{operation.responses[this.state.selectedStatus].description && (
Expand Down

0 comments on commit 52042e7

Please sign in to comment.