Add sort to index pages

This commit is contained in:
Shweelan Samson authored and Zaid Abdulla committed 2018-12-26 00:22:07 -08:00
1 parent 6ab9ba800c
commit 991ca16e03
8 files changed
+257 -56

No files matched your search

+3 -1
View File
@@ -198,7 +198,9 @@ function inferQuery(resourceType, queryResponse) {
function fetch(resourceType, filter, options = {}) {
const filterStr = memoizedStringify(filter);
const sort = options.sort || {};
const sort = Object.assign({}, options.sort);
for (const [k, v] of Object.entries(sort)) sort[k] += Math.sign(v);
const limit = options.limit || 0;
if (resourceType === "devices")
sort["DeviceID.ID"] = sort["DeviceID.ID"] || 1;