fix redirect back roles

This commit is contained in:
arifal
2025-03-12 20:30:16 +07:00
parent b0d4d4c23b
commit 7a82ad5302
9 changed files with 56 additions and 55 deletions

View File

@@ -6,6 +6,7 @@ class CreateRoles {
initCreateRole() {
const toastNotification = document.getElementById("toastNotification");
const toast = new bootstrap.Toast(toastNotification);
let menuId = document.getElementById("menuId").value;
document
.getElementById("btnCreateRole")
.addEventListener("click", async function () {
@@ -41,7 +42,7 @@ class CreateRoles {
result.message;
toast.show();
setTimeout(() => {
window.location.href = "/roles";
window.location.href = `/roles?menu_id=${menuId}`;
}, 2000);
} else {
let error = await response.json();