diff --git a/src/SearchPage.js b/src/SearchPage.js index 43d2079..d8484c6 100644 --- a/src/SearchPage.js +++ b/src/SearchPage.js @@ -12,8 +12,17 @@ class SearchPage extends Component { } onSearch = (query) => { + const books = this.props.books + // console.log(books) if (query.length > 3) { search(query).then((results) => { + for (result in results) { + for (book in books) { + if (result === book) { + result.shelf = book.shelf + } + } + } this.setState({ results }); }) }