From 98ab689b28c93175e718ce848e28716a7a0217ea Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Sat, 13 Jul 2024 20:26:32 -0400 Subject: [PATCH] lint --- clientv2/src/components/AuthContext/index.tsx | 3 +-- .../src/components/ProfileViewer/options.ts | 2 +- .../src/pages/student/StudentProfile.page.tsx | 23 +++++++++++-------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/clientv2/src/components/AuthContext/index.tsx b/clientv2/src/components/AuthContext/index.tsx index 1e057b7..41e3c79 100644 --- a/clientv2/src/components/AuthContext/index.tsx +++ b/clientv2/src/components/AuthContext/index.tsx @@ -137,9 +137,8 @@ export const AuthProvider: React.FC = ({ children }) => { }; const tokenResponse = await instance.acquireTokenSilent(silentRequest); return tokenResponse.accessToken; - } else { - throw new Error('More than one account found, cannot proceed.'); } + throw new Error('More than one account found, cannot proceed.'); } catch (error) { console.error('Silent token acquisition failed.', error); if (error instanceof InteractionRequiredAuthError) { diff --git a/clientv2/src/components/ProfileViewer/options.ts b/clientv2/src/components/ProfileViewer/options.ts index 1d97bdd..169f465 100644 --- a/clientv2/src/components/ProfileViewer/options.ts +++ b/clientv2/src/components/ProfileViewer/options.ts @@ -174,7 +174,7 @@ const otherMajors = [ export const degreeOptions = [ "Associate's", - `Bachelor's`, + 'Bachelor\'s', "Master's (Thesis)", "Master's (Non-Thesis)", 'PhD', diff --git a/clientv2/src/pages/student/StudentProfile.page.tsx b/clientv2/src/pages/student/StudentProfile.page.tsx index 156dcd6..a15ee7d 100644 --- a/clientv2/src/pages/student/StudentProfile.page.tsx +++ b/clientv2/src/pages/student/StudentProfile.page.tsx @@ -1,13 +1,13 @@ import { useEffect, useState } from 'react'; import { Alert, Button, Container, Grid } from '@mantine/core'; import { notifications } from '@mantine/notifications'; +import { IconInfoCircle } from '@tabler/icons-react'; import { useAuth } from '@/components/AuthContext'; import { HeaderNavbar } from '@/components/Navbar'; import { useApi } from '@/util/api'; import FullScreenLoader from '@/components/AuthContext/LoadingScreen'; import StudentProfilePage, { StudentProfileDetails } from '@/components/ProfileViewer'; import FullPageError from '@/components/FullPageError'; -import { IconInfoCircle } from '@tabler/icons-react'; export function StudentHomePage() { const { userData } = useAuth(); @@ -29,8 +29,8 @@ export function StudentHomePage() { for (let i = 0; i < response.data.degrees.length; i++) { response.data.degrees[i].gpa = parseFloat(response.data.degrees[i].gpa); } - if (response.data['defaultResponse']) { - response.data['name'] = userData?.name; + if (response.data.defaultResponse) { + response.data.name = userData?.name; setNewUser(true); } setStudentData(response.data as StudentProfileDetails); @@ -117,7 +117,7 @@ export function StudentHomePage() { setLoading(false); setFile(null); return showErrorSaveNotification('Could not upload resume.'); - } else { + } try { const presignedUrl = response.data.url; if (!presignedUrl) { @@ -132,10 +132,9 @@ export function StudentHomePage() { setFile(null); return showErrorSaveNotification('Could not upload resume.'); } - } } if ('defaultResponse' in studentData) { - delete studentData['defaultResponse']; + delete studentData.defaultResponse; setStudentData(studentData); } setLoading(true); @@ -179,9 +178,15 @@ export function StudentHomePage() { {newUser ? ( - - }> - We've provided you with a basic profile to get started. Fill out the details and save your profile to make it visible to recruiters. + + } + > + We've provided you with a basic profile to get started. Fill out the details and save + your profile to make it visible to recruiters. ) : null}