remove data-bs-dismiss
This commit is contained in:
@@ -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:
|
||||
|
@@ -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(){
|
||||
|
Reference in New Issue
Block a user