mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix pagination if endpoint's total is not available
when using a connection that has softscans disabled (e.g. D1) pagination failed. Fixing it by overfetching and slicing
This commit is contained in:
@@ -44,7 +44,7 @@ export function EntityRelationalFormField({
|
||||
const ref = useRef<any>(null);
|
||||
const $q = useEntityQuery(field.target(), undefined, {
|
||||
select: query.select,
|
||||
limit: query.limit,
|
||||
limit: query.limit + 1 /* overfetch for softscan=false */,
|
||||
offset: (query.page - 1) * query.limit,
|
||||
});
|
||||
const [_value, _setValue] = useState<{ id: number | undefined; [key: string]: any }>();
|
||||
|
||||
Reference in New Issue
Block a user