{"size": 483, "ext": "js", "max_stars_repo_path": "client/src/utils/API.js", "max_stars_repo_name": "bread-w/gt-react-google-books", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/utils/API.js", "max_issues_repo_name": "bread-w/gt-react-google-books", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/src/utils/API.js", "max_forks_repo_name": "bread-w/gt-react-google-books", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.4210526316, "max_line_length": 79, "alphanum_fraction": 0.6252587992}
import axios from "axios";
export default {
  getSearchedBook: function (query) {
    return axios.get(`https://www.googleapis.com/books/v1/volumes?q=${query}`);
  },

  getSavedBook: function () {
    return axios.get("/api/books").then((res) => res.data);
  },

  saveBook: function (bookData) {
    return axios.post("/api/books/", bookData).then((res) => res.data);
  },

  deleteBook: function (id) {
    return axios.delete("/api/books/" + id).then((res) => res.data);
  },
};
