formulaire pour utilisateur specifique
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
checkToken();
|
||||
signOut();
|
||||
|
||||
var nbPages = 20;
|
||||
|
||||
@@ -32,6 +33,12 @@ instance.get("users", {withCredentials: true, params :{ page:0, nbPages: nbPages
|
||||
td[1].textContent = listData[i].pseudo
|
||||
td[2].textContent = listData[i].email
|
||||
td[3].textContent = listData[i].roles
|
||||
var classTd = ".disableStatus";
|
||||
if(listData[i].status){
|
||||
classTd = ".activeStatus";
|
||||
}
|
||||
td[4].querySelector(classTd).classList.remove("hidden");
|
||||
|
||||
trAll[i].addEventListener("click", function(e){
|
||||
console.log(e.currentTarget)
|
||||
});
|
||||
@@ -40,11 +47,4 @@ instance.get("users", {withCredentials: true, params :{ page:0, nbPages: nbPages
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("signout").addEventListener("click", function(){
|
||||
instance.delete("token" , {withCredentials:true}).then(function(response){
|
||||
if(response.status == 200){
|
||||
location.href="/"
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -13,4 +13,16 @@ function checkToken(){
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function signOut(){
|
||||
|
||||
document.getElementById("signout").addEventListener("click", function(){
|
||||
instance.delete("token" , {withCredentials:true}).then(function(response){
|
||||
if(response.status == 200){
|
||||
location.href="/"
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
2
web/js/users.js
Normal file
2
web/js/users.js
Normal file
@@ -0,0 +1,2 @@
|
||||
checkToken();
|
||||
signOut();
|
Reference in New Issue
Block a user