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