add updateParam

This commit is contained in:
Valentin CZERYBA 2022-08-25 22:21:02 +02:00
parent 8819e6124f
commit d39f5921be
2 changed files with 20 additions and 4 deletions

View File

@ -110,3 +110,19 @@ function getQuery(param){
}
return result;
}
function updateParam(param, value){
var result = "";
if(location.search.length > 0){
query = location.search.split("?")[1];
var variables = query.split("&");
for (var i=0; i<variables.length; i++){
var data = variabes[i];
if(variables[i].split("=")[0] == param){
data = param+"="+value;
}
result = result + "&" + data;
}
}
return result;
}

View File

@ -93,9 +93,9 @@ instance.get("users", {withCredentials: true, params :param}).then(function(resp
var trAll = document.querySelectorAll("#users tbody tr")
td = trAll[i].querySelectorAll("td");
td[0].textContent = listData[i].id;
td[1].textContent = listData[i].pseudo
td[2].textContent = listData[i].email
td[3].textContent = listData[i].roles
td[1].textContent = listData[i].pseudo;
td[2].textContent = listData[i].email;
td[3].textContent = listData[i].roles;
var classTd = "";
switch(listData[i].status){
case 1: