feat: implement cover image upload with canvas compression and db storage in RIT-EMS-main

This commit is contained in:
2026-06-19 09:37:29 +05:30
parent 91842646f0
commit 785fe05902
17 changed files with 1217 additions and 453 deletions

View File

@@ -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'));
}