diff --git a/src/components/SearchStories.js b/src/components/SearchStories.js index 2f14850..24c20de 100644 --- a/src/components/SearchStories.js +++ b/src/components/SearchStories.js @@ -23,9 +23,12 @@ class SearchStories extends Component { @action onSubmit(event) { + const { storyStore } = this.props; + if (this.query) { fetchStories(this.query) - .then(result => this.props.storyStore.setStories(result.hits)) + .then(result => storyStore.setStories(result.hits)) + .catch(storyStore.setError); this.query = ''; } diff --git a/src/components/Stories.js b/src/components/Stories.js index 639cbf6..3d5fe6d 100644 --- a/src/components/Stories.js +++ b/src/components/Stories.js @@ -29,6 +29,8 @@ const Stories = ({ storyStore }) =>
Something went wrong ...
} + {(storyStore.readableStories || []).map(story =>