This commit is contained in:
Ken Jannette
2018-04-21 16:16:17 -04:00
parent 8137b0b7a9
commit 1a84c1b333
3 changed files with 4 additions and 6 deletions

View File

@@ -47,7 +47,6 @@ class BooksApp extends React.Component {
const id = e.target.name
const newShelf = e.target.value
const books = this.state.books
books.forEach((book) => {
if (book.id === id) {
book.shelf = newShelf;

View File

@@ -5,7 +5,6 @@ class Bookshelf extends Component {
render() {
const books = this.props.books
const onSelect = this.props.onSelect
return (
<div className="list-books">

View File

@@ -15,10 +15,10 @@ class SearchPage extends Component {
const books = this.props.books
if (query.length > 3) {
search(query).then((results) => {
for (var result in results) {
for (var book in books) {
if (result === book) {
result.shelf = book.shelf
for (var i = 0; i < books.length; i++) {
for (var j = 0; j < results.length; j++) {
if (results[j] === books[i]) {
results[j].shelf = books[i].shelf
}
}
}