From 6290b85b82029553029a0d9db0a0f2f349d565f3 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 1 Jul 2020 08:48:57 +0200 Subject: [PATCH] Replaced the AJAX failure callback function --- assets/js/backend_calendar_unavailabilities_modal.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/assets/js/backend_calendar_unavailabilities_modal.js b/assets/js/backend_calendar_unavailabilities_modal.js index f565d120..c95b68cc 100755 --- a/assets/js/backend_calendar_unavailabilities_modal.js +++ b/assets/js/backend_calendar_unavailabilities_modal.js @@ -58,7 +58,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili unavailable.id = $dialog.find('#unavailable-id').val(); } - var successCallback = function (response) { + var successCallback = function () { // Display success message to the user. Backend.displayNotification(EALang.unavailable_saved); @@ -68,15 +68,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili $('#select-filter-item').trigger('change'); }; - var errorCallback = function (jqXHR, textStatus, errorThrown) { - GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' + - 'the operation could not complete due to server communication errors.'); - - $dialog.find('.modal-message').txt(EALang.service_communication_error); - $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); - }; - - BackendCalendarApi.saveUnavailable(unavailable, successCallback, errorCallback); + BackendCalendarApi.saveUnavailable(unavailable, successCallback, GeneralFunctions.ajaxFailureHandler); }); /**