templates/universal/buttons/delete/js.html.twig line 1

Open in your IDE?
  1. <script type="text/javascript">
  2.     function listFunctionDelete(href) {
  3.         if (href !== '') {
  4.             if (confirm("{{ options.confirmMessage|trans }}")) {
  5.                 $.ajax({
  6.                     type: "DELETE",
  7.                     url: href
  8.                 }).done(function (data) {
  9.                     if (data.status) {
  10.                         alert(data.message);
  11.                         window.location.reload();
  12.                     }
  13.                     else {
  14.                         alert(data.message);
  15.                     }
  16.                 });
  17.             }
  18.         }
  19.         else {
  20.             alert("{{ 'universal.button.noHref.alert'|trans }}");
  21.         }
  22.     }
  23. </script>