mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-12-22 17:50:22 -05:00
Allow dashboard updates for models that have only files or images
This commit is contained in:
parent
1082c0f39b
commit
f15fb617ff
1 changed files with 18 additions and 14 deletions
32
resources/assets/js/dashboard.js
vendored
32
resources/assets/js/dashboard.js
vendored
|
@ -628,21 +628,25 @@ function editItemInit() {
|
|||
getFormData();
|
||||
|
||||
// submit the update
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/dashboard/update",
|
||||
data: formData
|
||||
}).always(function(response) {
|
||||
if (/^id:[0-9][0-9]*$/.test(response)) {
|
||||
uploadImage(response.replace(/^id:/, ""), 0);
|
||||
} else {
|
||||
loadingModal("hide");
|
||||
if (Object.keys(formData.columns).length) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/dashboard/update",
|
||||
data: formData
|
||||
}).always(function(response) {
|
||||
if (/^id:[0-9][0-9]*$/.test(response)) {
|
||||
uploadImage(response.replace(/^id:/, ""), 0);
|
||||
} else {
|
||||
loadingModal("hide");
|
||||
|
||||
showAlert("Failed to " + operation + " record", function() {
|
||||
submitting = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
showAlert("Failed to " + operation + " record", function() {
|
||||
submitting = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uploadImage(formData.id, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue