Commit c89d816f by windychikita20

update js

parent d1f1ee6b
......@@ -289,51 +289,6 @@
function destroy(url){
Swal.fire({
title: 'Apakah Anda Yakin?',
text: "Anda akan menghapus data ini!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Ya'
}).then((result) => {
if (result.isConfirmed) {
var token = "{{ csrf_token() }}";
var request = $.ajax({
url : url,
type : "DELETE",
dataType : "html",
data : {_token: token, _method: 'PUT'},
success: function(data){
Swal.fire({
position: 'top-end',
icon: 'success',
title: 'Berhasil menghapus data',
showConfirmButton: false,
timer: 1500
});
location.reload();
},
error: function(data){
Swal.fire({
position: 'top-end',
icon: 'error',
title: 'Gagal menghapus data',
showConfirmButton: false,
timer: 1500
})
}
})
}
})
}
</script>
@endpush
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment