From 96f201f26714487cc916a079ed6eb0e739eab147 Mon Sep 17 00:00:00 2001 From: vivek kasture Date: Fri, 13 Sep 2024 00:45:37 +0530 Subject: [PATCH] Issue #PS-000 fix: Added queryparams for selected cohort --- src/pages/course-planner.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/course-planner.tsx b/src/pages/course-planner.tsx index 05bd5e19..d687a34f 100644 --- a/src/pages/course-planner.tsx +++ b/src/pages/course-planner.tsx @@ -80,6 +80,7 @@ const CoursePlanner = () => { const handleCohortChange = (event: any) => { setSelectedValue(event.target.value); + addQueryParams({ center: event.target.value }); }; useEffect(() => { @@ -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()); @@ -136,7 +137,7 @@ const CoursePlanner = () => { (field: any) => field.label === label ); - if (field && field.value) { + if (field?.value) { setter(field.value.trim()); } }); @@ -146,7 +147,9 @@ const CoursePlanner = () => { } }; - fetchCohortSearchResults(); + if (selectedValue) { + fetchCohortSearchResults(); + } }, [selectedValue]); return (