Skip to content

Commit 7668d8f

Browse files
committed
handles keyset pagination
1 parent 17757b5 commit 7668d8f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

v2/definitions/strat_names.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ module.exports = function (req, res, next, cb) {
175175
},
176176
{
177177
data: response.rows,
178+
last_id: lastIdOut,
178179
},
179180
);
180181
}

v2/larkin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ const { Client, Pool } = require("pg");
243243
.send(JSON.stringify(outgoing.data, null, 0));
244244
}
245245

246+
if (options.last_id) {
247+
outgoing.last_id = options.last_id;
248+
}
249+
246250
if (options.refs) {
247251
larkin.getRefs(options.refs, outgoing.data, function (refs) {
248252
outgoing.refs = refs;
@@ -266,6 +270,10 @@ const { Client, Pool } = require("pg");
266270
responseObject.success["refs"] = outgoing.refs;
267271
}
268272

273+
if (outgoing.last_id) {
274+
responseObject.success["last_id"] = outgoing.last_id;
275+
}
276+
269277
if ((options && options.compact) || outgoing.data.length <= 5) {
270278
return res
271279
.set("Content-type", "application/json; charset=utf-8")

0 commit comments

Comments
 (0)