Minor typo fix
This commit is contained in:
@@ -4,7 +4,7 @@ import { Link, Route } from 'react-router-dom'
|
|||||||
// import * as BooksAPI from './BooksAPI'
|
// import * as BooksAPI from './BooksAPI'
|
||||||
import Bookshelf from './Bookshelf'
|
import Bookshelf from './Bookshelf'
|
||||||
import createHistory from 'history/createBrowserHistory'
|
import createHistory from 'history/createBrowserHistory'
|
||||||
import { getAll, search } from './BooksAPI'
|
import { getAll, search, update } from './BooksAPI'
|
||||||
import SearchPage from './SearchPage'
|
import SearchPage from './SearchPage'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
|
|
||||||
@@ -48,9 +48,11 @@ 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;
|
||||||
|
update(book, newShelf)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.setState({ books });
|
this.setState({ books });
|
||||||
|
|||||||
Reference in New Issue
Block a user