remove data-bs-dismiss

This commit is contained in:
2022-08-14 19:32:40 +02:00
parent 10180c917f
commit b9aefc1dcd
4 changed files with 41 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
checkToken();
signOut();
closeButton();
document.getElementById("addUser").addEventListener("click", function(){
@@ -60,8 +61,15 @@ document.getElementById("addUser").addEventListener("click", function(){
}
document.getElementById(idAlert+"Alert").classList.remove("hidden");
}).catch(function(error){
switch(error.status){
console.log(error);
switch(error.response.status){
case 401:
listExist = [ "pseudo", "email" ];
for(var i=0; i<listExist.length; i++){
if(error.response.data[listExist[i]]){
document.getElementById(listExist[i]+"ExistAlert").classList.remove("hidden");
}
}
idAlert="notAuthorized";
break;
case 403:

View File

@@ -11,6 +11,11 @@ function checkToken(){
if(location.pathname != "/"){
location.href="/";
}
if(error.response.status == 406){
instance.delete("token" , {withCredentials:true}).then(function(response){
location.reload();
});
}
});
}
@@ -20,11 +25,11 @@ function signOut(){
document.getElementById("signout").addEventListener("click", function(){
instance.delete("token" , {withCredentials:true}).then(function(response){
if(response.status == 200){
location.href="/"
if(response.status == 200) {
location.href="/";
}
});
});
});
}
function closeButton(){