From 953e86cb5e5627fa8addfe7a69ebda015ebfde53 Mon Sep 17 00:00:00 2001 From: adhi0331 Date: Fri, 14 Jun 2024 23:22:39 -0500 Subject: [PATCH] fixed some bugs and deleted some log statements --- frontend/src/components/NotificationCard/NotificationTable.tsx | 2 +- frontend/src/components/StudentsTable/StudentsTable.tsx | 1 - frontend/src/hooks/redirect.tsx | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/NotificationCard/NotificationTable.tsx b/frontend/src/components/NotificationCard/NotificationTable.tsx index 87048865..1a27fdab 100644 --- a/frontend/src/components/NotificationCard/NotificationTable.tsx +++ b/frontend/src/components/NotificationCard/NotificationTable.tsx @@ -76,7 +76,7 @@ export default function NotificationTable({ firebaseToken }: NotificationsProps) name={user.name} email={user.email} // account_type={user.role} - account_type={user.accountType} // console log shows correct property name is accountType + account_type={user.role} // console log shows correct property name is accountType onApprove={() => handleApproveUser(user.email)} onDeny={() => handleDenyUser(user.email)} /> diff --git a/frontend/src/components/StudentsTable/StudentsTable.tsx b/frontend/src/components/StudentsTable/StudentsTable.tsx index a6dae28e..8a23a1f5 100644 --- a/frontend/src/components/StudentsTable/StudentsTable.tsx +++ b/frontend/src/components/StudentsTable/StudentsTable.tsx @@ -44,7 +44,6 @@ export default function StudentsTable() { obj[student._id] = student; return obj; }, {} as StudentMap); - console.log(result.data); setAllStudents(studentsObject); setIsLoading(false); diff --git a/frontend/src/hooks/redirect.tsx b/frontend/src/hooks/redirect.tsx index 58bf0b4b..006f8e12 100644 --- a/frontend/src/hooks/redirect.tsx +++ b/frontend/src/hooks/redirect.tsx @@ -53,7 +53,7 @@ export const useRedirection = ({ checkShouldRedirect, redirectURL }: UseRedirect */ export const useRedirectToHomeIfSignedIn = () => { useRedirection({ - checkShouldRedirect: ({ firebaseUser, piaUser }) => firebaseUser !== null && piaUser !== null, + checkShouldRedirect: ({ firebaseUser, piaUser }) => firebaseUser !== null && piaUser !== null && piaUser.approvalStatus, redirectURL: HOME_URL, }); };