Added funcitonality to search result select to change shelf of selected book
This commit is contained in:
@@ -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]
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user