checkToken(); signOut(); closeButton(); pathURL = document.location.pathname.split("/")[document.location.pathname.split("/").length-1].split(".")[0].replace("add","") document.getElementById("addUser").addEventListener("click", function(){ switch (pathURL){ case "users": var updateProfil = ["username", "email", "firstName", "birth", "password"]; break; case "events": var updateProfil = ["name", "place", "start_date", "end_date"]; break; default: var updateProfil = [] break; } var updateOk = true; for (var i=0; i 0){ document.getElementById("displayUser").textContent=user; } break; case 204: idAlert="notModified" break; default: idAlert="unknown"; break } document.getElementById(idAlert+"Alert").classList.remove("hidden"); }).catch(function(error){ console.log(error); switch(error.response.status){ case 401: listExist = [ "username", "email" ]; for(var i=0; i