adding modifications for the front
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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 = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user