React-based Google Books Search app that displays books on user searches. Users can save them to review or purchase later.
Save
button to save the book to the database.
View
button to view the book on Google Books.
This project was bootstrapped with Create React App.
This App is deployed on Heroku: Google Books Search
MVC design pattern: Model, View, Controller.
-
Search for books using the Google Books API
getBook: function (query) {
return axios.get(`https://www.googleapis.com/books/v1/volumes?q=${query}`);
},
// Delete book with the given id
deleteBook: function (id) {
return axios.delete("/api/books/" + id).then(result => result.data);
},
// Save book to the database
saveBook: function (bookData) {
return axios.post("/api/books", bookData).then(result => result.data);
},
// Get saved books from the database
savedBooks: function () {
return axios.get("/api/books").then(result => result.data);
}
Victoire Baron | Victoire44