diff --git a/lib/www/server/lib/db/sequence/get.js b/lib/www/server/lib/db/sequence/get.js index f30c95c..01e992e 100644 --- a/lib/www/server/lib/db/sequence/get.js +++ b/lib/www/server/lib/db/sequence/get.js @@ -28,8 +28,8 @@ async function get (projectId, sequence, opts = {}) { ]; const sortKey = opts.sortBy && sortFields.includes(opts.sortBy) && opts.sortBy || "tstamp"; const sortDir = opts.sortDesc == "false" ? "ASC" : "DESC"; - const offset = Math.abs((opts.page-1)*opts.itemsPerPage) || 0; - const limit = Math.abs(Number(opts.itemsPerPage)) || null; + const offset = Math.abs(opts.offset) || Math.abs((opts.page-1)*opts.itemsPerPage) || 0; + const limit = Math.abs(opts.limit) || Math.abs(Number(opts.itemsPerPage)) || null; const restriction = sequence != 0 ? "sequence = $3"