mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +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:
@@ -61,7 +61,7 @@ function DataEntityListImpl({ params }) {
|
||||
(api) =>
|
||||
api.data.readMany(entity?.name as any, {
|
||||
select: search.value.select,
|
||||
limit: search.value.perPage,
|
||||
limit: search.value.perPage + 1 /* overfetch for softscan=false */,
|
||||
offset: (search.value.page - 1) * search.value.perPage,
|
||||
sort: `${search.value.sort.dir === "asc" ? "" : "-"}${search.value.sort.by}`,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user