No msg
This commit is contained in:
@@ -47,7 +47,6 @@ class BooksApp extends React.Component {
|
|||||||
const id = e.target.name
|
const id = e.target.name
|
||||||
const newShelf = e.target.value
|
const newShelf = e.target.value
|
||||||
const books = this.state.books
|
const books = this.state.books
|
||||||
|
|
||||||
books.forEach((book) => {
|
books.forEach((book) => {
|
||||||
if (book.id === id) {
|
if (book.id === id) {
|
||||||
book.shelf = newShelf;
|
book.shelf = newShelf;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ class Bookshelf extends Component {
|
|||||||
render() {
|
render() {
|
||||||
const books = this.props.books
|
const books = this.props.books
|
||||||
const onSelect = this.props.onSelect
|
const onSelect = this.props.onSelect
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<div className="list-books">
|
<div className="list-books">
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ class SearchPage extends Component {
|
|||||||
const books = this.props.books
|
const books = this.props.books
|
||||||
if (query.length > 3) {
|
if (query.length > 3) {
|
||||||
search(query).then((results) => {
|
search(query).then((results) => {
|
||||||
for (var result in results) {
|
for (var i = 0; i < books.length; i++) {
|
||||||
for (var book in books) {
|
for (var j = 0; j < results.length; j++) {
|
||||||
if (result === book) {
|
if (results[j] === books[i]) {
|
||||||
result.shelf = book.shelf
|
results[j].shelf = books[i].shelf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user