Skip to content

Commit 8a34ec6

Browse files
committed
Merge branch 'jordins/PG-686-fix-pagination-error' into beta
2 parents 28ba215 + b9c6dca commit 8a34ec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/sanitizeParams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default async function sanitizeParams(
106106
// When using secondary sort (paginatedField !== '_id'), we need _id for cursor encoding.
107107
// Cursors are encoded as [paginatedFieldValue, _id] tuples (see encodePaginationTokens in query.ts).
108108
// Without _id, the cursor would be encoded as a string, breaking pagination on subsequent pages.
109-
if (shouldSecondarySortOnId && params.fields._id === 0) {
109+
if (shouldSecondarySortOnId && !params.fields._id) {
110110
params.fields._id = 1;
111111
}
112112
}

0 commit comments

Comments
 (0)