From 008c8e61a83f6835f7b7e9a3707c3e767795f6f6 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Fri, 18 Jul 2025 16:09:57 +0700 Subject: [PATCH] feat: update user role routing --- lib/auth-utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/auth-utils.ts b/lib/auth-utils.ts index 788fb471..bcac0dd1 100644 --- a/lib/auth-utils.ts +++ b/lib/auth-utils.ts @@ -10,7 +10,6 @@ import { getCookiesDecrypt, setCookiesEncrypt } from "@/lib/utils"; // Navigation configuration based on user roles export const NAVIGATION_CONFIG: NavigationConfig[] = [ - { roleId: 18, path: "/in/dashboard/executive-data", label: "Executive Data Dashboard" }, { roleId: 2, path: "/in/dashboard/executive", label: "Executive Dashboard" }, { roleId: 3, path: "/in/dashboard", label: "Dashboard" }, { roleId: 4, path: "/in/dashboard", label: "Dashboard" }, @@ -18,6 +17,10 @@ export const NAVIGATION_CONFIG: NavigationConfig[] = [ { roleId: 10, path: "/in/dashboard", label: "Dashboard" }, { roleId: 11, path: "/in/dashboard", label: "Dashboard" }, { roleId: 12, path: "/in/dashboard", label: "Dashboard" }, + { roleId: 13, path: "/in/dashboard", label: "Dashboard" }, + { roleId: 14, path: "/in/dashboard", label: "Dashboard" }, + { roleId: 15, path: "/in/dashboard", label: "Dashboard" }, + { roleId: 18, path: "/in/dashboard/executive-data", label: "Executive Data Dashboard" }, { roleId: 19, path: "/in/dashboard", label: "Dashboard" }, ]; @@ -101,6 +104,8 @@ export const isSpecialLevel = (userLevelId: number, parentLevelId?: number): boo // Navigation utilities export const getNavigationPath = (roleId: number, userLevelId?: number, parentLevelId?: number): string => { const config = NAVIGATION_CONFIG.find(nav => nav.roleId === roleId); + + console.log("Navigation Config : ", config); if (config) { // Special handling for role 2 with specific level conditions