feat: implement cover image upload with canvas compression and db storage in RIT-EMS-main
This commit is contained in:
@@ -70,7 +70,8 @@ export const ApprovalsView: React.FC = () => {
|
||||
const data = await response.json();
|
||||
// Filter based on role
|
||||
if (user?.role === 'HOD') {
|
||||
setEvents(data.filter((e: Event) => e.status === 'REQUESTED' && e.department === user.department));
|
||||
const userDepts = user.department ? user.department.split(',').map(d => d.trim().toLowerCase()) : [];
|
||||
setEvents(data.filter((e: Event) => e.status === 'REQUESTED' && userDepts.includes(e.department?.trim().toLowerCase())));
|
||||
} else if (user?.role === 'PRINCIPAL') {
|
||||
setEvents(data.filter((e: Event) => e.status === 'PENDING_PR'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user