From 509acba92776d696531f350ca50e4954ad6cc8c8 Mon Sep 17 00:00:00 2001 From: tofulm Date: Fri, 3 Jun 2022 13:19:06 +0200 Subject: [PATCH] ajoute l'affichage via un alert si message_erreur en retour d'une action --- js/gamutable.es6.js | 6 +++++- js/gamutable.js | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index 88358fc..a077824 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -18,8 +18,9 @@ jQuery(function () { console.time('Chargement de VueJs APRES Ajax'); $.ajax({ url: url, + dataType: 'json', async: true, - }).done(function () { + }).done(function (retour) { if (parseInt(id) > 0) { app.rechargerJson(id); app.rechargerJson_deux(id); @@ -34,6 +35,9 @@ jQuery(function () { callback: function () {}, }); } + if (Array.isArray(retour) && retour.message_erreur !== undefined) { + alert(retour.message_erreur); + } }); }); diff --git a/js/gamutable.js b/js/gamutable.js index 7b73d71..c984d76 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -45,8 +45,9 @@ jQuery(function () { console.time('Chargement de VueJs APRES Ajax'); $.ajax({ url: url, + dataType: 'json', async: true - }).done(function () { + }).done(function (retour) { if (parseInt(id) > 0) { app.rechargerJson(id); app.rechargerJson_deux(id); @@ -64,6 +65,10 @@ jQuery(function () { callback: function callback() {} }); } + + if (Array.isArray(retour) && retour.message_erreur !== undefined) { + alert(retour.message_erreur); + } }); }); // lancement d'une modalbox