nico/28-nov-25 #26

Merged
nicoarya20 merged 5 commits from nico/28-nov-25 into staggingweb 2025-11-28 15:39:08 +08:00
2 changed files with 42 additions and 2 deletions
Showing only changes of commit 1c1e8fb190 - Show all commits

View File

@@ -35,13 +35,6 @@ export default async function userUpdate(context: Context) {
const isActiveChanged =
isActive !== undefined && currentUser.isActive !== isActive;
// ✅ Jika role berubah, hapus semua akses menu yang ada
if (isRoleChanged) {
await prisma.userMenuAccess.deleteMany({
where: { userId: id }
});
}
// ✅ Jika role berubah, reset dan set ulang akses menu
if (isRoleChanged && roleId) {
// Hapus akses lama
@@ -63,8 +56,6 @@ export default async function userUpdate(context: Context) {
}
}
// Update user
const updatedUser = await prisma.user.update({
where: { id },