mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-22 16:04:10 -05:00
Display the correct failed operation on the dashboard edit-item page when it fails to edit/create a record
This commit is contained in:
parent
d667c39af9
commit
880a578454
1 changed files with 3 additions and 2 deletions
|
@ -226,7 +226,8 @@ function editItemInit() {
|
||||||
$spinner = $("#loading-modal"),
|
$spinner = $("#loading-modal"),
|
||||||
fadeTime = 250,
|
fadeTime = 250,
|
||||||
model = $editItem.data("model"),
|
model = $editItem.data("model"),
|
||||||
id = $editItem.data("id");
|
id = $editItem.data("id"),
|
||||||
|
operation = id === "new" ? "create" : "update";
|
||||||
|
|
||||||
let allowTimes = [],
|
let allowTimes = [],
|
||||||
simplemde = [],
|
simplemde = [],
|
||||||
|
@ -415,7 +416,7 @@ function editItemInit() {
|
||||||
uploadImage(response.replace(/^id:/, ""));
|
uploadImage(response.replace(/^id:/, ""));
|
||||||
} else {
|
} else {
|
||||||
hideLoadingModal();
|
hideLoadingModal();
|
||||||
showAlert("ERROR: Failed to update record");
|
showAlert("ERROR: Failed to " + operation + " record");
|
||||||
submitting = false;
|
submitting = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue