added delete visualizer
This commit is contained in:
@@ -1173,7 +1173,35 @@ desired effect
|
||||
submitHandler: submitFormAddNewVisualizer
|
||||
});
|
||||
|
||||
$(document).on('button click', '#btn_delete_visualizer', function() {
|
||||
|
||||
if (!confirm("Are you sure you want to delete this Visualizer?")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var vis_id = $(this).data('id');
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "{{ url('admin/visualizer/delete') }}",
|
||||
data : {
|
||||
id: vis_id
|
||||
},
|
||||
beforeSend: function(xhr){
|
||||
var token = $('meta[name="csrf_token"]').attr('content');
|
||||
if (token) {
|
||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||
}
|
||||
},
|
||||
success : function(response){
|
||||
console.log(response)
|
||||
if(response.success){
|
||||
alert(response.message);
|
||||
window.location = "../visualizer"
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}); // end document ready
|
||||
|
||||
function formatStatePattern (state) {
|
||||
|
||||
Reference in New Issue
Block a user