Simplify alert message call
@@ -188,13 +188,13 @@ $(document).ready(function () {
}
else {
console.log(response);
- showCreateError();
+ customAlert("Error", 'Failed to create resource.', "error", 6000);
}
$("html").css("cursor", "initial");
},
error: function (response) {
console.log(response);
- showCreateError();
+ customAlert("Error", 'Failed to create resource.', "error", 6000);
$("html").css("cursor", "initial");
}
});
@@ -433,7 +433,7 @@ function customAlert(alertTitle, alertMessage, alertType, duration) {
// Displays error message if resource creation fails and restores UI state
function showCreateError() {
- customAlert("Error", 'Failed to create resource.', "error", 10000)();
+ customAlert("Error", 'Failed to create resource.', "error", 10000);
$(".btn-create-resource").removeClass("disabled");
$(".btn-create-resource").text("Create Resource");
$(".btn-cancel-create-resource").removeClass("disabled");
