Added funcitonality to search result select to change shelf of selected book

This commit is contained in:
Ken Jannette
2018-04-20 17:18:40 -04:00
parent 8ccdb86796
commit f4b22acccd

View File

@@ -30,13 +30,12 @@ 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
let newBook let newBook
get(id).then((result) => { get(id).then((result) => {
newBook = result newBook = result
newBook.shelf = newShelf newBook.shelf = newShelf
}); this.setState({
this.setState({ books: [...this.state.books, newBook]
books: [...this.state.books, newBook] });
}); });
} }