adding modifications for the front
This commit is contained in:
@@ -96,6 +96,7 @@ function dispatch(action) {
|
||||
async function createNotification(title, description, variant) {
|
||||
try {
|
||||
const user = await krowSDK.auth.me();
|
||||
|
||||
if (!user) {
|
||||
console.warn("Cannot create notification: user not authenticated.");
|
||||
return;
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function StaffDirectory() {
|
||||
if (!krowUser || !staff) return [];
|
||||
const userRole = krowUser.user_role || krowUser.role;
|
||||
|
||||
if (['admin', 'procurement', 'operator', 'sector'].includes(userRole)) {
|
||||
if (['admin', 'procurement', 'operator', 'sector'].includes(userRole.toLowerCase())) {
|
||||
return staff;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export default function StaffDirectory() {
|
||||
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 getPageTitle = () => {
|
||||
|
||||
Reference in New Issue
Block a user