From 67b92d7737746e54ffcf0fb479f6a30987b41abe Mon Sep 17 00:00:00 2001 From: Stefan Probst Date: Wed, 15 May 2024 16:00:49 +0200 Subject: [PATCH] fix: use update api endpoint to fetch publications and authors for filter options --- src/lib/sola/hooks.ts | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/lib/sola/hooks.ts b/src/lib/sola/hooks.ts index 7258a1e..e439b6e 100644 --- a/src/lib/sola/hooks.ts +++ b/src/lib/sola/hooks.ts @@ -27,10 +27,8 @@ import { getSolaPassageTopics, getSolaPassageTypes, getSolaPersonById, - getSolaPersons, getSolaPlaceById, getSolaPublicationById, - getSolaPublications, getSolaTextById, getSolaTextTypes, getSolaUsers, @@ -288,8 +286,6 @@ export function useSolaSelectedEntity() { export function useSolaFilterOptions() { const locale = useCurrentLocale() - const { person } = useSolaRelationTypes() - const passageTopics = useQuery( ['getSolaPassageTopics', locale, {}], () => { @@ -304,24 +300,10 @@ export function useSolaFilterOptions() { }, { select: mapResultsById }, ) - const publications = useQuery( - ['getSolaPublications', locale, {}], - () => { - return getSolaPublications({ query: defaultQuery, locale }) - }, - { select: mapResultsById }, - ) - const authorQuery = { publication_relationtype_set__id: person.isAuthorOf } - const authors = useQuery( - ['getSolaPersons', locale, authorQuery], - () => { - return getSolaPersons({ - query: { ...authorQuery, ...defaultQuery }, - locale, - }) - }, - { select: mapResultsById }, - ) + + const { data } = useSolaEntities() + const publications = data?.publications ?? {} + const authors = data?.persons ?? {} return { authors,