client/src/pages/Search.js
// Then reload books from the database
Then reload books from the database
Then reload books from the database
function handleFormSubmit(event) {
    event.preventDefault();
    if (formObject.title && formObject.author) {
      API.saveBook({
        id: formObject.id,
        image: formObject.image,
        title: formObject.title,
        authors: formObject.authors[0],
        description: formObject.description,
        link: formObject.link,
      })
        .then(res => loadBooks(res))
        .catch(err => console.log(err));
    }
  }
function handleFormSubmit ( event ) { event . preventDefault ( ) ; if ( formObject . title && formObject . author ) { API . saveBook ( { id : formObject . id , image : formObject . image , title : formObject . title , authors : formObject . authors [ 0 ] , description : formObject . description , link : formObject . link , } ) . then ( res => loadBooks ( res ) ) . catch ( err => console . log ( err ) ) ; } }
Then reload books from the database
Then reload books from the database