diff --git a/resources/assets/js/dashboard.js b/resources/assets/js/dashboard.js index e158398..d012989 100644 --- a/resources/assets/js/dashboard.js +++ b/resources/assets/js/dashboard.js @@ -306,7 +306,12 @@ function editItemInit() { // functionality to run on success const returnSuccess = function() { 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