Added update API call to onResultSelect in app.js
This commit is contained in:
@@ -37,6 +37,10 @@ class BooksApp extends React.Component {
|
||||
books: [...this.state.books, newBook]
|
||||
});
|
||||
});
|
||||
const newBooks = this.state.books
|
||||
newBooks.forEach((book) => {
|
||||
update(book, book.shelf)
|
||||
})
|
||||
}
|
||||
|
||||
onSelectChange = (e) => {
|
||||
|
||||
@@ -37,7 +37,7 @@ class SearchPage extends Component {
|
||||
</div>
|
||||
<div className="search-books-results">
|
||||
<ol className="books-grid">
|
||||
{
|
||||
{ this.state.results.length > 0 && (
|
||||
this.state.results.map((result) => {
|
||||
return <li key={result.id}>
|
||||
<div className="book">
|
||||
@@ -58,6 +58,7 @@ class SearchPage extends Component {
|
||||
</div>
|
||||
</li>
|
||||
})
|
||||
)
|
||||
}
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user