From 65b35bc9a3d415354b525dfb495b698530bf82e7 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 10 Mar 2025 09:35:52 -0500 Subject: [PATCH] fix(user): when user didnt hape permissions would error, changed to have undefined now --- frontend/src/utils/userAccess.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/userAccess.ts b/frontend/src/utils/userAccess.ts index 98cb8cd..5977769 100644 --- a/frontend/src/utils/userAccess.ts +++ b/frontend/src/utils/userAccess.ts @@ -18,7 +18,7 @@ export function hasPageAccess(user: User | null, role: any, module_id: string): // get only the module in the user profile const userRole = user?.roles.filter((role) => role.module_id === module_id); - if (role.includes(userRole[0].role)) { + if (role.includes(userRole[0]?.role)) { return true; }