Fetch directly from db instead of API
This commit is contained in:
1 parent
2319f8d698
commit
db900622a0
7 files changed
+423
-407
No files matched your search
+4
-5
@@ -71,7 +71,7 @@ function count(resourceType, filter) {
|
||||
|
||||
function limitFilter(resourceType, filter, last) {
|
||||
if (resourceType === "devices")
|
||||
return expression.and(filter, ["<=", "DeviceID.ID", last]);
|
||||
return expression.and(filter, ["<=", ["PARAM", "DeviceID.ID"], last]);
|
||||
else return expression.and(filter, ["<=", ["PARAM", "_id"], last]);
|
||||
}
|
||||
|
||||
@@ -83,11 +83,10 @@ function findMatches(resourceType, filter, limit) {
|
||||
Array.isArray(e) &&
|
||||
Array.isArray(e[1]) &&
|
||||
e[1][0] === "PARAM" &&
|
||||
e[1][0] === "tag"
|
||||
e[1][1] === "tag"
|
||||
)
|
||||
if (e[0] === "=") return ["=", ["PARAM", `Tags.${e[2]}`], true];
|
||||
else if (e[0] === "<>")
|
||||
return ["NOT", ["=", ["PARAM", `Tags.${e[2]}`], true]];
|
||||
if (e[0] === "=") return ["IS NOT NULL", ["PARAM", `Tags.${e[2]}`]];
|
||||
else if (e[0] === "<>") return ["IS NULL", ["PARAM", `Tags.${e[2]}`]];
|
||||
return e;
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user