This commit is contained in:
Valentin CZERYBA 2023-11-07 21:09:45 +01:00
parent ed6d7dc4f1
commit 48c7e38c87
3 changed files with 17 additions and 14 deletions

View File

@ -171,9 +171,10 @@
<tr>
<th><input type="checkbox" id="checkboxPrincipal" aria-label="Checkbox for following text input"></th>
<th scope="col">ID</th>
<th scope="col">Username</th>
<th scope="col">Mail</th>
<th scope="col">Rôle</th>
<th scope="col">Nom</th>
<th scope="col">Lieu</th>
<th scope="col">Date de début</th>
<th scope="col">Date de fin</th>
<th scope="col">Statut</th>
<th scope="col"></th>
</tr>
@ -185,6 +186,7 @@
<td></td>
<td></td>
<td></td>
<td></td>
<td><span class="activeStatus hidden">Activé</span><span class="disableStatus hidden">Désactivé</span><span class="confirmStatus hidden">En attente de confirmation</span><span class="removeStatus hidden">En attente de suppression</span><span class="unknownStatus hidden">Statut inconnu</span></td>
<td><button type="button" class="btn btn-primary" data-bs-toggle="modal" userid="" data-bs-target="#updateUserModal">Modifier</button></td>
</tr>

View File

@ -26,14 +26,13 @@ document.getElementById("addUser").addEventListener("click", function(){
}
dataPut = {
"username": document.getElementById("usernameUpdateInput").value,
"email": document.getElementById("emailUpdateInput").value,
"name": document.getElementById("nameUpdateInput").value,
"firstName": document.getElementById("firstNameUpdateInput").value,
"birth": document.getElementById("birthUpdateInput").value,
"password": document.getElementById("passwordUpdateInput").value,
"roles": selector["roles"]
"username": document.getElementById("usernameUpdateInput").value,
"email": document.getElementById("emailUpdateInput").value,
"name": document.getElementById("nameUpdateInput").value,
"firstName": document.getElementById("firstNameUpdateInput").value,
"birth": document.getElementById("birthUpdateInput").value,
"password": document.getElementById("passwordUpdateInput").value,
"roles": selector["roles"]
}
instance({
method : "put",

View File

@ -59,11 +59,13 @@ function buildParam(typeInput){
if(search.length > 0){
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(search)){
param = param + "email="+search+"&";
} else {
} else if (/^[a-fA-F0-9]{24}$/.test(search)){
param = param + "id="+search+"&";
}
} else {
param = param + "name="+search+"&";
}
} else {
listParam.push("email"); listParam.push("id");
listParam.push("email"); listParam.push("id"); listParam.push("name");
}
for (var i=0; i<listParam.length; i++){