title: How to delete rows of data using sequelize?
body: <p>So I have the following router in a pug file called <strong>books.js</strong>, in this router I am using the Sequelize ORM to find a row of data based on the id in order to deleted</p>
  
  <pre><code>    /* - Deletes a book. Careful, this can’t be undone. 
  It can be helpful to create a new “test” book to test deleting.
  
  create the post /books/:id/delete route*/
  router.post('/:id/delete', function(req, res, next){
    Book.findOne({where: {id: req.params.id}}).then(function(book){
      return book.destroy();
    }).then(function(){
      res.redirect('/books/');  
    })
  });
  </code></pre>
  
  <p>this is the form inside a pug file called <strong>update-book.pug</strong> where I have a button that once pressed it should delete the row of data and redirect to /books</p>
  
  <pre><code>form(action="/books/" + book.id , method="post" onsubmit="return confirm('Do you really want to delete this book?');")
  </code></pre>
  
  <p>Once I press the delete button, I get the 200(ok) status code, but my browser stays in the same page</p>
  
  <p><a href="https://i.stack.imgur.com/JDyZ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JDyZ6.png" alt="enter image description here"></a></p>
  
  <p>can someone help? for reference this is my repo <a href="https://github.com/SpaceXar20/sql_library_manager-updated" rel="nofollow noreferrer">https://github.com/SpaceXar20/sql_library_manager-updated</a></p>