Skip to content

Commit

Permalink
Issue #PS-000 fix: Added queryparams for selected cohort
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Sep 12, 2024
1 parent b8a1655 commit 96f201f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/course-planner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const CoursePlanner = () => {

const handleCohortChange = (event: any) => {
setSelectedValue(event.target.value);
addQueryParams({ center: event.target.value });
};

useEffect(() => {
Expand Down Expand Up @@ -121,7 +122,7 @@ const CoursePlanner = () => {
(field: any) => field.label === label
);

if (field && field.value) {
if (field?.value) {
const valuesArray = field.value
.split(',')
.map((item: string) => item.trim());
Expand All @@ -136,7 +137,7 @@ const CoursePlanner = () => {
(field: any) => field.label === label
);

if (field && field.value) {
if (field?.value) {
setter(field.value.trim());
}
});
Expand All @@ -146,7 +147,9 @@ const CoursePlanner = () => {
}
};

fetchCohortSearchResults();
if (selectedValue) {
fetchCohortSearchResults();
}
}, [selectedValue]);

return (
Expand Down

0 comments on commit 96f201f

Please sign in to comment.