Sort sequence list by sequence descending by default

This commit is contained in:
D. Berge
2020-08-25 18:31:51 +02:00
parent da3d273c41
commit c7c8f5df8a

View File

@@ -7,8 +7,8 @@ async function list (projectId, opts = {}) {
"sequence", "line", "length", "azimuth", "fsp", "lsp",
"ts0", "ts1", "duration", "num_points", "missing_shots", "remarks"
];
const sortKey = opts.sortBy && sortFields.includes(opts.sortBy) && opts.sortBy || "line";
const sortDir = opts.sortDesc == "true" ? "DESC" : "ASC";
const sortKey = opts.sortBy && sortFields.includes(opts.sortBy) && opts.sortBy || "sequence";
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 filter = opts.filter;