Skip to content

Commit

Permalink
fixed course code bug
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacNguyen committed Nov 23, 2024
1 parent 4ec635a commit 9ffd237
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions apps/antalmanac/src/lib/grades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ class _Grades {
department,
ge,
instructor,
sectionCode,
}: {
department?: string;
ge?: GE;
instructor?: string;
sectionCode?: string;
}): Promise<void> => {
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 ?? ''}`;

Expand Down
18 changes: 0 additions & 18 deletions apps/backend/.env.sample

This file was deleted.

0 comments on commit 9ffd237

Please sign in to comment.