[Vuejs]-Sweetalert deleting items even if we click "NO"

1👍

You need to add

Swal.fire({
  .
  .
  .
}).then((result) => {
  if (result.value) { // This check here. This contains value for the delete button. Its null for cancel button
    ...
  }
})

You are sending delete request without any check on it. So apply this check before the delete call

Leave a comment