From b14d9e049439d4be9866c3cadfc6c529fdc98e25 Mon Sep 17 00:00:00 2001 From: Aaron Couch Date: Tue, 25 Jun 2024 23:41:53 -0400 Subject: [PATCH] Further Clean up status WIP --- frontend/src/app/[locale]/look/SearchBar.tsx | 4 ++-- .../src/app/[locale]/look/SearchOpportunityStatus.tsx | 2 -- frontend/src/app/[locale]/look/page.tsx | 8 +++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/[locale]/look/SearchBar.tsx b/frontend/src/app/[locale]/look/SearchBar.tsx index 9f2b930361..4a0e7b3460 100644 --- a/frontend/src/app/[locale]/look/SearchBar.tsx +++ b/frontend/src/app/[locale]/look/SearchBar.tsx @@ -7,7 +7,7 @@ import { QueryContext } from "./QueryProvider"; import { useContext } from "react"; interface SearchBarProps { - query: string; + query: string | null | undefined; } export default function SearchBar({ query }: SearchBarProps) { @@ -46,7 +46,7 @@ export default function SearchBar({ query }: SearchBarProps) { id="query" type="search" name="query" - defaultValue={query} + defaultValue={query || ""} onChange={(e) => updateQueryTerm(e.target?.value)} onKeyDown={(e) => { if (e.key === 'Enter') { diff --git a/frontend/src/app/[locale]/look/SearchOpportunityStatus.tsx b/frontend/src/app/[locale]/look/SearchOpportunityStatus.tsx index f799cf651c..993634a078 100644 --- a/frontend/src/app/[locale]/look/SearchOpportunityStatus.tsx +++ b/frontend/src/app/[locale]/look/SearchOpportunityStatus.tsx @@ -38,8 +38,6 @@ export default function SearchOpportunityStatus({ selectedStatuses }: SearchOppo const router = useRouter(); const statuses = Array.from(selectedStatuses).join(","); - // console.log(Array.from(selectedStatuses).join(","), statuses) - const updateAll = (statusValue: string, isChecked: boolean) => { const params = new URLSearchParams(searchParams); const currentStatus = params.get('status'); diff --git a/frontend/src/app/[locale]/look/page.tsx b/frontend/src/app/[locale]/look/page.tsx index c7aead9957..9f8c1c4c6d 100644 --- a/frontend/src/app/[locale]/look/page.tsx +++ b/frontend/src/app/[locale]/look/page.tsx @@ -35,11 +35,9 @@ export default function Look({ }) { unstable_setRequestLocale("en"); const t = useTranslations("Process"); - const key = searchParams.toString() + const key = Object.entries(searchParams).join(',') const convertedSearchParams = convertSearchParamsToProperTypes(searchParams); - - const query = convertedSearchParams?.query || ''; - const statuses = convertedSearchParams?.status || ''; + const { query, status } = convertedSearchParams; return ( <> @@ -54,7 +52,7 @@ export default function Look({
- +
}>