diff --git a/web/html/adduser.html b/web/html/adduser.html index 36f63e5..4565e32 100644 --- a/web/html/adduser.html +++ b/web/html/adduser.html @@ -123,7 +123,7 @@ - + +

Liste d'utilisateur

diff --git a/web/js/user.js b/web/js/user.js index 53929a5..842268e 100644 --- a/web/js/user.js +++ b/web/js/user.js @@ -144,19 +144,37 @@ if(id.length > 0){ withCredentials: true, data: dataPut }).then(function(response){ + var idAlert = ""; switch(response.status){ case 200: location.reload(); break; case 304: - console.log("non modifie"); + idAlert="noContent"; break; default: - console.log("error inconnue"); - break + idAlert="unknown"; + break; } + document.getElementById(idAlert+"Alert").classList.remove("hidden"); + }).catch(function(error){ - console.log(error); + var idAlert = ""; + switch(error.status){ + case 401: + idAlert="notAuthorized"; + break; + case 403: + idAlert="forbidden"; + break; + case 500: + idAlert="internalServer"; + break; + default: + idAlert="unknown"; + break; + } + document.getElementById(idAlert+"Alert").classList.remove("hidden"); }); }