From b4fa74771479053bf6fdfd6916cb09eff9d76282 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 11 Aug 2022 21:33:24 +0200 Subject: [PATCH] complete profil 100% --- web/html/user.html | 2 +- web/js/user.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/web/html/user.html b/web/html/user.html index a24d985..cabd929 100644 --- a/web/html/user.html +++ b/web/html/user.html @@ -155,7 +155,7 @@
Mot de passe - +
diff --git a/web/js/user.js b/web/js/user.js index caaa162..53929a5 100644 --- a/web/js/user.js +++ b/web/js/user.js @@ -139,12 +139,22 @@ if(id.length > 0){ } instance({ - method : "put", + method : "patch", url:"users/"+id, withCredentials: true, data: dataPut }).then(function(response){ - console.log(response); + switch(response.status){ + case 200: + location.reload(); + break; + case 304: + console.log("non modifie"); + break; + default: + console.log("error inconnue"); + break + } }).catch(function(error){ console.log(error); });