Updating user-listing

merge-requests/7/head
dilanua 8 years ago
parent bbce1a3d8a
commit 99aca9b90a

@ -108,7 +108,7 @@ $("a.invite-user-link").click(function () {
invokerUtil.post( invokerUtil.post(
inviteUserAPI, inviteUserAPI,
usernameList, usernameList,
// The success callback // success callback
function (data, textStatus, jqXHR) { function (data, textStatus, jqXHR) {
if (jqXHR.status == 200) { if (jqXHR.status == 200) {
$(modalPopupContent).html($('#invite-user-success-content').html()); $(modalPopupContent).html($('#invite-user-success-content').html());
@ -117,7 +117,7 @@ $("a.invite-user-link").click(function () {
}); });
} }
}, },
// The error callback // error callback
function (jqXHR) { function (jqXHR) {
console.log("error in invite-user API, status code: " + jqXHR.status); console.log("error in invite-user API, status code: " + jqXHR.status);
$(modalPopupContent).html($('#invite-user-error-content').html()); $(modalPopupContent).html($('#invite-user-error-content').html());
@ -212,7 +212,7 @@ function resetPassword(uname) {
invokerUtil.post( invokerUtil.post(
resetPasswordServiceURL, resetPasswordServiceURL,
resetPasswordFormData, resetPasswordFormData,
// The success callback // success callback
function (data, textStatus, jqXHR) { function (data, textStatus, jqXHR) {
if (jqXHR.status == 200) { if (jqXHR.status == 200) {
$(modalPopupContent).html($('#reset-password-success-content').html()); $(modalPopupContent).html($('#reset-password-success-content').html());
@ -221,7 +221,7 @@ function resetPassword(uname) {
}); });
} }
}, },
// The error callback // error callback
function (jqXHR) { function (jqXHR) {
console.log("error in reset-password API, status code: " + jqXHR.status); console.log("error in reset-password API, status code: " + jqXHR.status);
var payload = JSON.parse(jqXHR.responseText); var payload = JSON.parse(jqXHR.responseText);
@ -271,14 +271,19 @@ function loadUsers() {
var objects = []; var objects = [];
$(data.users).each(function (index) { $(data.users).each(
objects.push({ function (index) {
objects.push(
{
username: data.users[index].username, username: data.users[index].username,
firstname: data.users[index].firstname ? data.users[index].firstname: '' , firstname: data.users[index].firstname ? data.users[index].firstname: '' ,
lastname: data.users[index].lastname ? data.users[index].lastname : '', lastname: data.users[index].lastname ? data.users[index].lastname : '',
emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress: '', emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress: '',
DT_RowId : "user-" + data.users[index].username}) DT_RowId : "user-" + data.users[index].username
}); }
)
}
);
var json = { var json = {
"recordsTotal": data.count, "recordsTotal": data.count,
@ -374,7 +379,9 @@ function loadUsers() {
]; ];
$("#user-grid").datatables_extended_serverside_paging(null, '/api/device-mgt/v1.0/users', dataFilter, columns, fnCreatedRow, null); $("#user-grid").datatables_extended_serverside_paging(
null, '/api/device-mgt/v1.0/users', dataFilter, columns, fnCreatedRow, null
);
$("#loading-content").hide(); $("#loading-content").hide();
} }

Loading…
Cancel
Save