From c22317b87ed9ddb8e3799cb5ebd51997830ee8be Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 5 Apr 2024 00:43:43 -0700 Subject: [PATCH] feat: handle colon in UCLA categories --- components/search/SearchResults.tsx | 13 ++++++++++++- components/search/SearchSelect.tsx | 30 +++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/components/search/SearchResults.tsx b/components/search/SearchResults.tsx index 21b9682..99068e4 100644 --- a/components/search/SearchResults.tsx +++ b/components/search/SearchResults.tsx @@ -88,7 +88,18 @@ const SearchResults = (props: SearchResultsProps) => {
{result.fulfillsGEs - .map((obj) => obj.category) + .map((obj) => { + const category = + obj.category; + + return category.includes( + ":", + ) + ? category.split( + ": ", + )[1] + : category; + }) .join(", ")}
diff --git a/components/search/SearchSelect.tsx b/components/search/SearchSelect.tsx index c7df1de..e904cfa 100644 --- a/components/search/SearchSelect.tsx +++ b/components/search/SearchSelect.tsx @@ -21,17 +21,31 @@ export const SearchSelect = (props: DropdownComponentProps) => { return (