From 83fb39a957e8f9dc554a0283d74e59777be8f0e2 Mon Sep 17 00:00:00 2001 From: nico Date: Fri, 28 Nov 2025 15:00:09 +0800 Subject: [PATCH 1/2] Fix Ganti Role, ganti role menunya sudah menyesuaikan --- .../admin/(dashboard)/user&role/user/page.tsx | 10 ++++--- src/app/api/[[...slugs]]/_lib/user/updt.ts | 26 +++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/app/admin/(dashboard)/user&role/user/page.tsx b/src/app/admin/(dashboard)/user&role/user/page.tsx index 5f133409..6147337d 100644 --- a/src/app/admin/(dashboard)/user&role/user/page.tsx +++ b/src/app/admin/(dashboard)/user&role/user/page.tsx @@ -93,6 +93,7 @@ function ListUser({ search }: { search: string }) { const success = await stateUser.update.submit({ id: userId, roleId: newRoleId, + }); if (success) { @@ -136,9 +137,10 @@ function ListUser({ search }: { search: string }) { } }; - const filteredData = (data || []).filter( - (item) => item.roleId !== "0" // asumsikan id role SUPERADMIN = "0" - ); + const filteredData = (data || []).filter((item) => { + return item.roleId !== "0" && item.roleId !== "1"; + }); + if (loading || !data) { return ( @@ -183,7 +185,7 @@ function ListUser({ search }: { search: string }) {