Add synonyms to db.sequence.get() options

This commit is contained in:
D. Berge
2025-08-01 17:05:05 +02:00
parent 4be99370e6
commit 471f4e8e64

View File

@@ -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"