feat: update user role routing

This commit is contained in:
hanif salafi 2025-07-18 16:09:57 +07:00
parent 38c5b513ff
commit 008c8e61a8
1 changed files with 6 additions and 1 deletions

View File

@ -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