Display the correct failed operation on the dashboard edit-item page when it fails to edit/create a record

This commit is contained in:
Kevin MacMartin 2017-01-03 22:55:12 -05:00
parent d667c39af9
commit 880a578454

View file

@ -226,7 +226,8 @@ function editItemInit() {
$spinner = $("#loading-modal"),
fadeTime = 250,
model = $editItem.data("model"),
id = $editItem.data("id");
id = $editItem.data("id"),
operation = id === "new" ? "create" : "update";
let allowTimes = [],
simplemde = [],
@ -415,7 +416,7 @@ function editItemInit() {
uploadImage(response.replace(/^id:/, ""));
} else {
hideLoadingModal();
showAlert("ERROR: Failed to update record");
showAlert("ERROR: Failed to " + operation + " record");
submitting = false;
}
});