mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-09 11:16:39 -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();
|
getFormData();
|
||||||
|
|
||||||
// submit the update
|
// submit the update
|
||||||
$.ajax({
|
if (Object.keys(formData.columns).length) {
|
||||||
type: "POST",
|
$.ajax({
|
||||||
url: "/dashboard/update",
|
type: "POST",
|
||||||
data: formData
|
url: "/dashboard/update",
|
||||||
}).always(function(response) {
|
data: formData
|
||||||
if (/^id:[0-9][0-9]*$/.test(response)) {
|
}).always(function(response) {
|
||||||
uploadImage(response.replace(/^id:/, ""), 0);
|
if (/^id:[0-9][0-9]*$/.test(response)) {
|
||||||
} else {
|
uploadImage(response.replace(/^id:/, ""), 0);
|
||||||
loadingModal("hide");
|
} else {
|
||||||
|
loadingModal("hide");
|
||||||
|
|
||||||
showAlert("Failed to " + operation + " record", function() {
|
showAlert("Failed to " + operation + " record", function() {
|
||||||
submitting = false;
|
submitting = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
uploadImage(formData.id, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue