refactor is_active trigger view and enable_otp trigger view in UserDetail page;trivial changes

This commit is contained in:
xiaokong1937@gmail.com
2016-09-06 21:03:51 +08:00
parent a3096689b5
commit 556fb4e09f
9 changed files with 329 additions and 118 deletions

View File

@@ -151,4 +151,25 @@ function getIDall() {
check_array.push(id);
});
return check_array.join(",");
}
}
function APIUpdateAttr(url, body, success, error, method) {
$.ajax({
url: url,
type: method || "PATCH",
data: body
}).done(function(data, textStatue, jqXHR) {
if (typeof success === 'function') {
return success(data)
} else {
toastr.success('Update Success!')
}
}).fail(function(jqXHR, textStatue, errorThrown) {
if (typeof error === 'function') {
return error(errorThrown)
} else {
toastr.error('Error occurred while updating.')
}
})
return true;
}