adding modifications for the front

This commit is contained in:
José Salazar
2025-12-02 09:20:00 -05:00
parent b76cde086a
commit bc5c08255f
2 changed files with 3 additions and 2 deletions

View File

@@ -96,6 +96,7 @@ function dispatch(action) {
async function createNotification(title, description, variant) { async function createNotification(title, description, variant) {
try { try {
const user = await krowSDK.auth.me(); const user = await krowSDK.auth.me();
if (!user) { if (!user) {
console.warn("Cannot create notification: user not authenticated."); console.warn("Cannot create notification: user not authenticated.");
return; return;

View File

@@ -52,7 +52,7 @@ export default function StaffDirectory() {
if (!krowUser || !staff) return []; if (!krowUser || !staff) return [];
const userRole = krowUser.user_role || krowUser.role; const userRole = krowUser.user_role || krowUser.role;
if (['admin', 'procurement', 'operator', 'sector'].includes(userRole)) { if (['admin', 'procurement', 'operator', 'sector'].includes(userRole.toLowerCase())) {
return staff; return staff;
} }
@@ -109,7 +109,7 @@ export default function StaffDirectory() {
return matchesSearch && matchesDepartment && matchesLocation; return matchesSearch && matchesDepartment && matchesLocation;
}); });
const canAddStaff = krowUser && ['admin', 'procurement', 'operator', 'sector', 'vendor'].includes(krowUser.user_role || krowUser.role); const canAddStaff = krowUser && ['admin', 'procurement', 'operator', 'sector', 'vendor'].includes((krowUser.user_role || krowUser.role || '').toLowerCase());
const isLoading = isLoadingStaff || isLoadingUser; const isLoading = isLoadingStaff || isLoadingUser;
const getPageTitle = () => { const getPageTitle = () => {