static.js.admin.clients.edit.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() {
$('.clientsave').submit(function(event) {
saveClient($(this), "/api/clients/save", "Save")
return false;
});
$("#generatetokens2").click(function() {
var uuid = guid();
$('#clientsecret2').attr("value", uuid);
});
$("#generatetokens").click(function() {
$('.client').attr("value", guid());
$('#clientsecret').attr("value", guid());
})
});