No msg
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -5,7 +5,6 @@ class Bookshelf extends Component {
|
||||
render() {
|
||||
const books = this.props.books
|
||||
const onSelect = this.props.onSelect
|
||||
|
||||
return (
|
||||
|
||||
<div className="list-books">
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user