Go back to the dashboard page once a new item has been created

This commit is contained in:
Kevin MacMartin 2017-04-29 01:12:01 -04:00
parent 3cadd8b957
commit 8678e98709

View file

@ -339,12 +339,7 @@ function editItemInit() {
// functionality to run on success // functionality to run on success
const returnSuccess = function() { const returnSuccess = function() {
hideLoadingModal(); hideLoadingModal();
window.location.href = "/dashboard/" + model;
if (operation === "create") {
window.location.href = "/" + location.href.replace(/^[^:]*:\/\/[^\/]*\//, "").replace(/\/[^/]*$/, "") + "/" + row_id;
} else {
window.location.href = "/dashboard/" + model;
}
}; };
// add the image from the image upload box for image-upload class elements // add the image from the image upload box for image-upload class elements