diff --git a/Untitled.png b/Untitled.png new file mode 100644 index 0000000..98fcbc1 Binary files /dev/null and b/Untitled.png differ diff --git a/src/App.js b/src/App.js index aabfe65..a4b1c1b 100644 --- a/src/App.js +++ b/src/App.js @@ -28,9 +28,9 @@ const App = () => { }, []); // Move books on different shelf function - const updateShelf = (book, shelf) => { - console.log('Move to =>', book, shelf); - BooksApi.update(book, shelf).catch((err) => { + const updateShelf = async (book, shelf) => { + // console.log('Move to =>', book, shelf); + await BooksApi.update(book, shelf).catch((err) => { console.log(err); }); if (shelf === 'none') { @@ -42,9 +42,9 @@ const App = () => { }; // Search books function - const searchBooks = debounce(200, false, (query) => { + const searchBooks = debounce(200, false, async (query) => { if (query.length > 0) { - BooksApi.search(query).then((book) => { + await BooksApi.search(query).then((book) => { if (book.error) { setSearchBooks([]); } else {