Skip to content

Commit

Permalink
Fix unhandled promise catch in catalog form
Browse files Browse the repository at this point in the history
  • Loading branch information
rvsia committed Mar 5, 2019
1 parent 4bf1282 commit afd81d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/javascript/components/catalog-form/catalog-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ class CatalogForm extends Component {
originalRightValues: rightValues,
isLoaded: true,
}), miqSparkleOff);
});
})
.catch(({ error: { message } = { message: __('Could not fetch the data') } }) => add_flash(message, 'error'), miqSparkleOff);
} else {
API.get('/api/service_templates?expand=resources&filter[]=service_template_catalog_id=null').then(
({ resources }) => this.setState({
schema: createSchema(resources.map(({ href, name }) => ({ key: href, label: name }))),
isLoaded: true,
}, miqSparkleOff),
);
)
.catch(({ error: { message } = { message: __('Could not fetch the data') } }) => add_flash(message, 'error'), miqSparkleOff);
}
}

Expand Down

0 comments on commit afd81d8

Please sign in to comment.