Replaced the AJAX failure callback function

This commit is contained in:
Alex Tselegidis 2020-07-01 08:48:57 +02:00
parent 531732c9a1
commit 6290b85b82

View file

@ -58,7 +58,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
unavailable.id = $dialog.find('#unavailable-id').val(); unavailable.id = $dialog.find('#unavailable-id').val();
} }
var successCallback = function (response) { var successCallback = function () {
// Display success message to the user. // Display success message to the user.
Backend.displayNotification(EALang.unavailable_saved); Backend.displayNotification(EALang.unavailable_saved);
@ -68,15 +68,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
$('#select-filter-item').trigger('change'); $('#select-filter-item').trigger('change');
}; };
var errorCallback = function (jqXHR, textStatus, errorThrown) { BackendCalendarApi.saveUnavailable(unavailable, successCallback, GeneralFunctions.ajaxFailureHandler);
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);
}); });
/** /**