Return search results directly from the server
This commit is contained in:
@@ -29,7 +29,7 @@ class Results extends React.Component {
|
||||
.then(res => res.json())
|
||||
.then(
|
||||
(result) => {
|
||||
this.setState({ stories: result.results });
|
||||
this.setState({ stories: result.hits });
|
||||
},
|
||||
(error) => {
|
||||
if (error.message !== 'The operation was aborted. ') {
|
||||
|
@@ -37,7 +37,7 @@ class Search extends Component {
|
||||
<span className='search'>
|
||||
<form onSubmit={this.searchAgain}>
|
||||
<input
|
||||
placeholder='Search... (fixed)'
|
||||
placeholder='Search...'
|
||||
value={search}
|
||||
onChange={this.searchArticles}
|
||||
ref={this.inputRef}
|
||||
|
Reference in New Issue
Block a user