Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Readding set items
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Jun 26, 2024
1 parent 747f9d5 commit 307c2dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions frontend/src/app/[locale]/look/SearchOpportunityStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface StatusOption {
}

interface SearchOpportunityStatusProps {
selectedStatuses: string;
selectedStatuses: Set<string>;
}

const statusOptions: StatusOption[] = [
Expand All @@ -36,7 +36,9 @@ export default function SearchOpportunityStatus({ selectedStatuses }: SearchOppo
const searchParams = useSearchParams() || undefined;
const pathname = usePathname() || "";
const router = useRouter();
const statuses = selectedStatuses ? selectedStatuses.split(",") : [];
const statuses = Array.from(selectedStatuses).join(",");

// console.log(Array.from(selectedStatuses).join(","), statuses)

const updateAll = (statusValue: string, isChecked: boolean) => {
const params = new URLSearchParams(searchParams);
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/app/[locale]/look/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Loading from "src/app/[locale]/search/loading";
import SearchResultsList from "./SearchResultList";
import QueryProvider from "./QueryProvider";
import SearchOpportunityStatus from "./SearchOpportunityStatus";
import { convertSearchParamsToProperTypes } from "src/utils/search/convertSearchParamsToProperTypes";

export async function generateMetadata() {
const t = await getTranslations({ locale: "en" });
Expand All @@ -34,8 +35,11 @@ export default function Look({
}) {
unstable_setRequestLocale("en");
const t = useTranslations("Process");
const query = searchParams?.query || '';
const statuses = searchParams?.status || '';
const key = searchParams.toString()
const convertedSearchParams = convertSearchParamsToProperTypes(searchParams);

const query = convertedSearchParams?.query || '';
const statuses = convertedSearchParams?.status || '';

return (
<>
Expand All @@ -53,7 +57,7 @@ export default function Look({
<SearchOpportunityStatus selectedStatuses={statuses} />
</div>
<div className="tablet:grid-col-8">
<Suspense key={query+statuses} fallback={<Loading />}>
<Suspense key={key} fallback={<Loading />}>
<SearchResultsList searchParams={searchParams} />
</Suspense>
</div>
Expand Down

0 comments on commit 307c2dd

Please sign in to comment.