From a965d01fb9fcff6e4ccfc1cd9d2a91d7cb2fb345 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Tue, 15 Aug 2023 18:51:40 +0200 Subject: [PATCH] Optimized server error display handling when consuming a recipe (closes #2310) --- localization/strings.pot | 3 --- public/viewjs/mealplan.js | 3 +-- public/viewjs/recipes.js | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/localization/strings.pot b/localization/strings.pot index 0f4dd8af..c6fe92a1 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1139,9 +1139,6 @@ msgstr "" msgid "Today" msgstr "" -msgid "Not all ingredients of recipe \"%s\" are in stock, nothing removed" -msgstr "" - msgid "Undo task" msgstr "" diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index 9c05c3aa..a068d6c2 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -906,9 +906,8 @@ $(document).on('click', '.recipe-consume-button', function(e) }, function(xhr) { - toastr.warning(__t('Not all ingredients of recipe "%s" are in stock, nothing removed', objectName)); Grocy.FrontendHelpers.EndUiBusy(); - console.error(xhr); + Grocy.FrontendHelpers.ShowGenericError("A server error occured while processing your request", xhr.response); } ); } diff --git a/public/viewjs/recipes.js b/public/viewjs/recipes.js index 12358e8c..5df5100b 100644 --- a/public/viewjs/recipes.js +++ b/public/viewjs/recipes.js @@ -265,8 +265,7 @@ $(".recipe-consume").on('click', function(e) function(xhr) { Grocy.FrontendHelpers.EndUiBusy(); - toastr.warning(__t('Not all ingredients of recipe "%s" are in stock, nothing removed', objectName)); - console.error(xhr); + Grocy.FrontendHelpers.ShowGenericError("A server error occured while processing your request", xhr.response); } ); }