diff --git a/hooks/store/publicLinks.tsx b/hooks/store/publicLinks.tsx index c59cced..86c7961 100644 --- a/hooks/store/publicLinks.tsx +++ b/hooks/store/publicLinks.tsx @@ -33,12 +33,15 @@ const usePublicLinks = (params: LinkRequestQuery = {}) => { } as LinkRequestQuery; const queryString = buildQueryString(queryParamsObject); + const { data, ...rest } = useFetchLinks(queryString); + const links = useMemo(() => { return data?.pages.reduce((acc, page) => { return [...acc, ...page]; }, []); }, [data]); + return { links, data: { ...data, ...rest }, diff --git a/yarn.lock b/yarn.lock index 9a56a48..d3403a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6521,4 +6521,4 @@ zustand@^4.3.8: resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.3.8.tgz#37113df8e9e1421b0be1b2dca02b49b76210e7c4" integrity sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg== dependencies: - use-sync-external-store "1.2.0" \ No newline at end of file + use-sync-external-store "1.2.0"