diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/DeptSearchBar/DeptSearchBar.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/DeptSearchBar/DeptSearchBar.tsx index 4b89685da..00036e564 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/DeptSearchBar/DeptSearchBar.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/DeptSearchBar/DeptSearchBar.tsx @@ -91,10 +91,12 @@ class DeptSearchBar extends PureComponent { + const formData = RightPaneStore.getFormData(); + this.setState({ value: { - deptValue: RightPaneStore.getFormData().deptValue, - deptLabel: RightPaneStore.getFormData().deptLabel, + deptValue: formData.deptValue, + deptLabel: formData.deptLabel, isFavorite: false, }, }); diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/CourseInfo/CourseInfoSearchButton.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/CourseInfo/CourseInfoSearchButton.tsx index b1a65667e..4ba49fd03 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/CourseInfo/CourseInfoSearchButton.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/CourseInfo/CourseInfoSearchButton.tsx @@ -25,6 +25,16 @@ export function CourseInfoSearchButton({ courseDetails, term }: { courseDetails: setActiveTab(1); }, []); + const queryParams = { + term: term, + deptValue: deptCode, + courseNumber: courseNumber, + }; + + const href = `/?${Object.entries(queryParams) + .map(([key, value]) => `${key}=${encodeURIComponent(value)}`) + .join('&')}`; + return (