diff --git a/ui/src/components/search/CheckboxFacet.tsx b/ui/src/components/search/CheckboxFacet.tsx index 22909f6e5..68cf7a2e0 100644 --- a/ui/src/components/search/CheckboxFacet.tsx +++ b/ui/src/components/search/CheckboxFacet.tsx @@ -24,7 +24,7 @@ const CheckboxFacet: React.FC = ({ const createQueryString = useCallback( (name: string, value: any) => { - const params = new URLSearchParams(searchParams) + const params = new URLSearchParams(searchParams.toString()) params.delete(name); params.delete("page"); diff --git a/ui/src/components/search/SearchPagination.tsx b/ui/src/components/search/SearchPagination.tsx index a7dc0292e..3db559b20 100644 --- a/ui/src/components/search/SearchPagination.tsx +++ b/ui/src/components/search/SearchPagination.tsx @@ -17,7 +17,7 @@ const SearchPagination: React.FC = ({ count, params }) => { const currentPage = searchParams.get("page") || 1 const onPageChange = (page: number) => { - const params = new URLSearchParams(searchParams) + const params = new URLSearchParams(searchParams.toString()) params.set("page", `${page}`); router.push(pathname + (params.toString() ? `?${params.toString()}` : '')); diff --git a/ui/src/components/search/YearFacet.tsx b/ui/src/components/search/YearFacet.tsx index 520f0ae55..f94b2b31d 100644 --- a/ui/src/components/search/YearFacet.tsx +++ b/ui/src/components/search/YearFacet.tsx @@ -42,7 +42,7 @@ const YearFacet = ({ data }: any) => { const createQueryString = useCallback( (name: string, value: any) => { - const params = new URLSearchParams(searchParams) + const params = new URLSearchParams(searchParams.toString()) params.delete(name); params.delete("page"); @@ -80,7 +80,7 @@ const YearFacet = ({ data }: any) => { const onBarMouseOut = () => setHoveredBar(null); const resetFilters = () => { - const params = new URLSearchParams(searchParams); + const params = new URLSearchParams(searchParams.toString()); params.delete('publication_year__range'); params.delete('page'); router.push(pathname + (params.toString() ? `?${params.toString()}` : ""))