From 9ffd2373f90a1c0db0dcd1d19c64cfab1455d5e7 Mon Sep 17 00:00:00 2001 From: Isaac Nguyen Date: Sat, 23 Nov 2024 14:43:10 -0800 Subject: [PATCH] fixed course code bug --- .../RightPane/CoursePane/CourseRenderPane.tsx | 1 + apps/antalmanac/src/lib/grades.ts | 7 +++++-- apps/backend/.env.sample | 18 ------------------ 3 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 apps/backend/.env.sample diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx index b787ceb5f..d539c5006 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx @@ -213,6 +213,7 @@ export default function CourseRenderPane(props: { id?: number }) { department: formData.deptValue, ge: formData.ge as GE, instructor: formData.instructor, + sectionCode: formData.sectionCode, }; try { diff --git a/apps/antalmanac/src/lib/grades.ts b/apps/antalmanac/src/lib/grades.ts index a6fcff70f..1319c260b 100644 --- a/apps/antalmanac/src/lib/grades.ts +++ b/apps/antalmanac/src/lib/grades.ts @@ -48,17 +48,20 @@ class _Grades { department, ge, instructor, + sectionCode, }: { department?: string; ge?: GE; instructor?: string; + sectionCode?: string; }): Promise => { department = department != 'ALL' ? department : undefined; ge = ge != 'ANY' ? ge : undefined; instructor = instructor != '' ? instructor : undefined; + sectionCode = sectionCode != '' ? sectionCode : undefined; - if (!department && !ge && !instructor) - throw new Error('populateGradesCache: Must provide either department, ge, or instructor'); + if (!department && !ge && !instructor && !sectionCode) + throw new Error('populateGradesCache: Must provide either department, ge, instructor, or section code'); const queryKey = `${department ?? ''}${ge ?? ''}`; diff --git a/apps/backend/.env.sample b/apps/backend/.env.sample deleted file mode 100644 index ef94bb420..000000000 --- a/apps/backend/.env.sample +++ /dev/null @@ -1,18 +0,0 @@ -# Only used to read legacy users. -AA_MONGODB_URI=uri - -# prod | dev | local -STAGE=local - -# Provided by CDK code when running on AWS. -USERDATA_TABLE_NAME=tablename - -# Provided by Lambda when running on AWS. -AWS_REGION=us-east-1 - -# For Mapbox API -MAPBOX_ACCESS_TOKEN=pk.abc123 - -# Anteater API key. -# If you don't have a key, you can get one at https://dashboard.anteaterapi.com -ANTEATER_API_KEY=placeholder