mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:27:07 +00:00
Add synonyms to db.sequence.get() options
This commit is contained in:
@@ -28,8 +28,8 @@ async function get (projectId, sequence, opts = {}) {
|
|||||||
];
|
];
|
||||||
const sortKey = opts.sortBy && sortFields.includes(opts.sortBy) && opts.sortBy || "tstamp";
|
const sortKey = opts.sortBy && sortFields.includes(opts.sortBy) && opts.sortBy || "tstamp";
|
||||||
const sortDir = opts.sortDesc == "false" ? "ASC" : "DESC";
|
const sortDir = opts.sortDesc == "false" ? "ASC" : "DESC";
|
||||||
const offset = Math.abs((opts.page-1)*opts.itemsPerPage) || 0;
|
const offset = Math.abs(opts.offset) || Math.abs((opts.page-1)*opts.itemsPerPage) || 0;
|
||||||
const limit = Math.abs(Number(opts.itemsPerPage)) || null;
|
const limit = Math.abs(opts.limit) || Math.abs(Number(opts.itemsPerPage)) || null;
|
||||||
|
|
||||||
const restriction = sequence != 0
|
const restriction = sequence != 0
|
||||||
? "sequence = $3"
|
? "sequence = $3"
|
||||||
|
|||||||
Reference in New Issue
Block a user