client/src/components/SearchedBookCard/index.js
// Saves a book to the database with a given id
Saves a book to the database with a given id
Saves a book to the database with a given id
function saveBook(book) {
    console.log('saving book');
    const bookDetails = {
        title: book.title, 
        authors: book.authors.split(', '),
        description: book.description,
        image: book.thumbnail,
        link: book.link
    };  
    API.saveBook(bookDetails)
      .then(alert('The book has been added to your saved list.'))
      .catch(err => console.log(err));
  }
function saveBook ( book ) { console . log ( 'saving book' ) ; const bookDetails = { title : book . title , authors : book . authors . split ( ', ' ) , description : book . description , image : book . thumbnail , link : book . link } ; API . saveBook ( bookDetails ) . then ( alert ( 'The book has been added to your saved list.' ) ) . catch ( err => console . log ( err ) ) ; }
Saves a book to the database with a given id
Saves a book to the database with a given id