Skip to content

Commit

Permalink
search: fix year filtering (typescript fix)
Browse files Browse the repository at this point in the history
Signed-off-by: pamfilos <[email protected]>
  • Loading branch information
pamfilos committed Nov 12, 2024
1 parent 09dcca6 commit 5c123f2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ui/src/components/search/YearFacet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useRouter, usePathname, useSearchParams } from "next/navigation";
import "react-vis/dist/style.css";

import { PublicationYear, YearFacetData } from "@/types";
import { URLSearchParams } from "url";


const mapInitialDataToYears = (
Expand Down Expand Up @@ -34,7 +33,7 @@ const YearFacet = ({ data }: any) => {
setInitialEndpoints(getSliderEndpoints(initialData));
}, [data]);

const resolveYearQuery = (name: string, params: URLSearchParams, range: number[]) => {
const resolveYearQuery = (name: string, params: any, range: number[]) => {
if (range[0] === range[1]) {
params.set(`${name}__gte`, range[0]?.toString()+"-01-01")
params.set(`${name}__lte`, range[0]?.toString()+"-12-31")
Expand Down

0 comments on commit 5c123f2

Please sign in to comment.