From 43710b5062257627af866571f13e5cbacdef9826 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 8 Jun 2019 16:53:31 +0200 Subject: [PATCH] Properly show the API error when it failed to undo a stock booking (fixes #267) --- localization/strings.pot | 3 +++ public/viewjs/stockjournal.js | 1 + 2 files changed, 4 insertions(+) diff --git a/localization/strings.pot b/localization/strings.pot index e45c8414..56e6796b 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1265,3 +1265,6 @@ msgstr "" msgid "Marked task %s as completed on %s" msgstr "" + +msgid "Booking has subsequent dependent bookings, undo not possible" +msgstr "" diff --git a/public/viewjs/stockjournal.js b/public/viewjs/stockjournal.js index fc7ac05c..19009d6e 100644 --- a/public/viewjs/stockjournal.js +++ b/public/viewjs/stockjournal.js @@ -69,6 +69,7 @@ $(document).on('click', '.undo-stock-booking-button', function(e) function(xhr) { console.error(xhr); + toastr.error(__t(JSON.parse(xhr.response).error_message)); } ); });