@@ -38,10 +43,10 @@ export default function WorksPage(props: WorksPageProps) {
transformItems: (items: Array) => {
return items
.filter((item) => {
- return item.label.startsWith(props.params.id_or_category);
+ return item.label.startsWith(props.params.category);
})
.map((item) => {
- const [_cat, year, title] = item.label.split("$");
+ const [year, title] = item.label.split("_");
item.label = Number.isNaN(parseInt(year!)) ? title! : `${title!} (${year!})`;
return item;
});
diff --git a/components/instantsearch/instantsearchprovider.tsx b/components/instantsearch/instantsearchprovider.tsx
index f6a0026..5eac08e 100644
--- a/components/instantsearch/instantsearchprovider.tsx
+++ b/components/instantsearch/instantsearchprovider.tsx
@@ -4,7 +4,6 @@ import type { UiState } from "instantsearch.js";
// eslint-disable-next-line no-restricted-imports
import singletonRouter from "next/router";
import type { ReactNode } from "react";
-import { Configure } from "react-instantsearch";
import { InstantSearchNext } from "react-instantsearch-nextjs";
import { createInstantSearchRouterNext } from "react-instantsearch-router-nextjs";
import type { SearchClient } from "typesense-instantsearch-adapter";
@@ -16,7 +15,6 @@ export interface InstantSearchProviderProps {
pathnameField?: string;
queryArgsToMenuFields?: Record;
defaultSort?: string;
- filters?: string;
searchClient: SearchClient;
}
@@ -26,7 +24,6 @@ export function InstantSearchProvider(props: InstantSearchProviderProps): ReactN
const {
children,
collectionName,
- filters,
defaultSort,
pageName,
pathnameField,
@@ -34,10 +31,6 @@ export function InstantSearchProvider(props: InstantSearchProviderProps): ReactN
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
searchClient,
} = props;
- const filter = filters
- ? // '&&' is typesense convention, not instantsearch!
- `erstpublikation:true && ${filters}`
- : "erstpublikation:true";
return (
-
{children}
);
diff --git a/components/instantsearch/sortby.tsx b/components/instantsearch/sortby.tsx
index 1b93055..67e2c2e 100644
--- a/components/instantsearch/sortby.tsx
+++ b/components/instantsearch/sortby.tsx
@@ -40,14 +40,9 @@ export function InstantSearchSortBy(props: InstantSearchSortByProps): ReactNode
const { currentRefinement, options, refine } = useSortBy({
items: sortByItems,
});
- // enforce initial sort
- if (currentRefinement === collectionName) {
- refine(`${collectionName}/sort/${props.sortOptions[0]!}`);
- }
-
return (