My beer compendium
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
356 B

3 years ago
  1. let axios = require("axios");
  2. //even delegation
  3. $("body").on("click", ".delete-projects", function() {
  4. let id = $(this).data("id");
  5. // axios will send a delete request with this URL
  6. axios
  7. .delete("/projects/" + id)
  8. .then(function() {
  9. window.location.reload();
  10. })
  11. .catch(function(error) {
  12. console.log(error);
  13. });
  14. });