Skip to content

Commit

Permalink
fix: transfer courses now counted for prereqs in search
Browse files Browse the repository at this point in the history
  • Loading branch information
timobraz committed Dec 7, 2024
1 parent 7737c81 commit ce0df0e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion site/src/component/SearchHitContainer/SearchHitContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ const SearchResults = ({
quarter.courses.map((course) => course.department + ' ' + course.courseNumber),
),
);
const transfers = roadmap?.transfers.map((transfer) => transfer.name);
if (index === 'courses') {
return (results as CourseGQLData[]).map((course, i) => {
const requiredCourses = Array.from(
validateCourse(new Set(allExistingCourses), course.prerequisiteTree, new Set(), course.corequisites),
validateCourse(
new Set([...allExistingCourses, ...transfers]),
course.prerequisiteTree,
new Set(),
course.corequisites,
),
);
return (
<CourseHitItem key={course.id} index={i} {...course} {...(requiredCourses.length > 0 && { requiredCourses })} />
Expand Down

0 comments on commit ce0df0e

Please sign in to comment.