From 0dbf71e6b520ec3a8c1d8767973fa6c48f64f97e Mon Sep 17 00:00:00 2001 From: dswbx Date: Sun, 26 Oct 2025 16:00:15 +0100 Subject: [PATCH] fix pagination on entity relations for softscan false --- app/src/ui/routes/data/data.$entity.$id.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/ui/routes/data/data.$entity.$id.tsx b/app/src/ui/routes/data/data.$entity.$id.tsx index a21d444..bb238bf 100644 --- a/app/src/ui/routes/data/data.$entity.$id.tsx +++ b/app/src/ui/routes/data/data.$entity.$id.tsx @@ -301,7 +301,11 @@ function EntityDetailInner({ // @todo: add custom key for invalidation const $q = useApiQuery( - (api) => api.data.readManyByReference(entity.name, id, other.reference, search), + (api) => + api.data.readManyByReference(entity.name, id, other.reference, { + ...search, + limit: search.limit + 1 /* overfetch for softscan=false */, + }), { keepPreviousData: true, revalidateOnFocus: true, @@ -320,7 +324,6 @@ function EntityDetailInner({ navigate(routes.data.entity.create(other.entity.name), { query: ref.where, }); - //navigate(routes.data.entity.create(other.entity.name) + `?${query}`); }; } } catch (e) {} @@ -330,6 +333,7 @@ function EntityDetailInner({ } const isUpdating = $q.isValidating || $q.isLoading; + const meta = $q.data?.body.meta; return (
{ setSearch((s) => ({ ...s,