How do make an axios call inside sweet alert popup on dlete and show the data in dropdown inside popup?

I get popup showing are you sure you want to delet this data? But what i want is I want to make an axios call and fetch data inside that popup, asking where do you want to shift the data related to that data inside ? and show the dropdown?

deleteBeacon(beacon) {
        title: "Are you sure?",
        text: "Do you really want to delete this beacon?",
        icon: "warning",
        buttons: true,
        dangerMode: true,
        .then((willDelete) => {
          if (willDelete) {
            return axios.delete("/beacons/" +;
          } else {
            swal("Cancelled", "Beacon is safe!", "error");
        .then((response) => {
          swal("Success",, "success");
          this.beacons.splice(this.editedIndex, 1);
        .catch((err) => {
          if (err.response.status == 401) {
          } else if (err.response.status == 404) {
              "Beacon does not exists or has been recently removed!",

This is my delete icon sweetalert popup,


This is the axios url to hit and fetch data, I want to show the data coming from hitting this url in that sweet akert popup

Source: Laravel

Leave a Reply