checkToken(); signOut(); var param = {} param["limit"] = 20; var listSearch = [ "email", "uuid", "search"]; for(var i=0; i 0){ document.getElementById("searchUser").value=search; } } var listQuery = [{"query": "roles", "id":"inputRoles"}, {"query":"status", "id":"inputStatus"}] for (var i=0; i 0){ var listOption = document.querySelectorAll("#"+listQuery[i]["id"]+" option"); for(var j=0; j 1){ document.getElementById("page").classList.remove("hidden"); var pageCurrent = getQuery("skip"); var page = 1; if(pageCurrent.length > 0){ page = Number.parseInt(pageCurrent); } for (var i=0; i 0){ param["skip"] = Number.parseInt(pageCurrent); param["skip"] = param["skip"] - 1; } var listQuery = ["search", "id", "roles", "status", "email"]; for (var i=0; i 0){ param[listQuery[i]]=query; } } instance.get("users", {withCredentials: true, params:param}).then(function(response){ var listData = response.data; if(!Array.isArray(listData)){ var listData = [] listData.push(response.data); } if(listData.length > 0 ){ var listModalButton = ["disable", "enable", "remove"]; for (var i=0; i 0){ userids.push(userid); } } } param["ids"]=userids; switch(e.currentTarget.id){ case "disableUserButton": httpMethod = "delete"; httpUrl = "users/groups"; break; case "removeUserButton": httpMethod = "delete"; httpUrl = "users/groups?remove=true"; break; default: httpMethod = "patch"; httpUrl = "users/groups"; break; } instance({ method: httpMethod, url: httpUrl, data:param, withCredentials: true }) .then(function(response){ if(response.status == 200){ location.href="/html/users.html"; } }) .catch(function(error){ console.log(error); }); }); } } for (var i=0; i