click event

This commit is contained in:
Valentin CZERYBA 2022-08-02 22:44:34 +02:00
parent a05f0db745
commit d7eb43f4b1
4 changed files with 13 additions and 3 deletions

View File

@ -147,7 +147,7 @@
</div>
</div>
<h2>Section title</h2>
<h2>Liste d'utilisateur</h2>
<div class="table-responsive">
<table id=users class="table table-striped table-sm">
<thead>
@ -156,7 +156,6 @@
<th scope="col">Pseudo</th>
<th scope="col">Mail</th>
<th scope="col">Rôle</th>
<th scope="col">Header</th>
</tr>
</thead>
<tbody>
@ -165,7 +164,6 @@
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>

View File

@ -50,6 +50,10 @@
<body class="text-center">
<main class="form-signin">
<div class="alert alert-danger alert-dismissible hidden" id="alertRequest" role="alert">
<div>Requête incorrecte</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible hidden" id="alertUsername" role="alert">
<div>Utilisateur inexistant</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>

View File

@ -32,6 +32,10 @@ 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
trAll[i].addEventListener("click", function(e){
console.log(e.currentTarget)
});
}
});
@ -43,3 +47,4 @@ document.getElementById("signout").addEventListener("click", function(){
}
});
});

View File

@ -10,6 +10,9 @@ document.getElementById("signin").addEventListener("submit", function(evt){
.catch(function(error){
switch (error.response.status){
case 400:
id = "alertRequest"
break;
case 406:
id = "alertPassword";
break;