static.js.admin.users.delete.js Maven / Gradle / Ivy
function deleteUser(sel, url) {
var data = sel.serialize();
$.ajax({
type : 'POST',
url : url + "?" + data,
contentType: 'application/json; charset=utf-8',
dataType : 'json',
success : function(data) {
hidemessages();
showsuccess(sel, "User Deleted");
},
error: function (data) {
hidemessages();
var text = JSON.parse(data.responseText)
showerror(sel, "Unable to Delete - " + text.message);
}
});
}
$(document).ready(function() {
$(".deleteuser").submit(function(event) {
deleteUser($(this), "/api/users/delete");
return false;
});
});