From 41c281b619a1e6e58956cd82b41d8996d2499d2c Mon Sep 17 00:00:00 2001 From: Ken Jannette Date: Fri, 20 Apr 2018 17:39:04 -0400 Subject: [PATCH] Added update API call to onResultSelect in app.js --- src/App.js | 4 ++++ src/SearchPage.js | 15 ++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/App.js b/src/App.js index 596748b..6d45d2f 100755 --- a/src/App.js +++ b/src/App.js @@ -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) => { diff --git a/src/SearchPage.js b/src/SearchPage.js index 7065ab0..724d39a 100644 --- a/src/SearchPage.js +++ b/src/SearchPage.js @@ -37,12 +37,12 @@ class SearchPage extends Component {
    - { - this.state.results.map((result) => { - return
  1. -
    -
    -
    + { this.state.results.length > 0 && ( + this.state.results.map((result) => { + return
  2. +
    +
    +