powr-sdk-api 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/plexx.js +8 -4
- package/package.json +1 -1
package/dist/services/plexx.js
CHANGED
|
@@ -30,7 +30,8 @@ class PlexxManager {
|
|
|
30
30
|
const projectId = config.projectId;
|
|
31
31
|
console.log(`📦 Loading routes for project: ${projectId}`);
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
33
|
+
const db = await getDb();
|
|
34
|
+
const routes = await db.collection("routes").find({
|
|
34
35
|
projectId
|
|
35
36
|
}).toArray();
|
|
36
37
|
routes.forEach(route => {
|
|
@@ -117,7 +118,8 @@ class PlexxManager {
|
|
|
117
118
|
throw new Error("Dynamic loading only available in central service mode");
|
|
118
119
|
}
|
|
119
120
|
try {
|
|
120
|
-
const
|
|
121
|
+
const db = await getDb();
|
|
122
|
+
const routeData = await db.collection("routes").findOne({
|
|
121
123
|
projectId,
|
|
122
124
|
route
|
|
123
125
|
});
|
|
@@ -139,7 +141,8 @@ class PlexxManager {
|
|
|
139
141
|
throw new Error("Dynamic loading only available in central service mode");
|
|
140
142
|
}
|
|
141
143
|
try {
|
|
142
|
-
const
|
|
144
|
+
const db = await getDb();
|
|
145
|
+
const routes = await db.collection("routes").find({
|
|
143
146
|
projectId
|
|
144
147
|
}).toArray();
|
|
145
148
|
routes.forEach(route => {
|
|
@@ -174,7 +177,8 @@ class PlexxManager {
|
|
|
174
177
|
|
|
175
178
|
// Optionally save to database
|
|
176
179
|
try {
|
|
177
|
-
await getDb()
|
|
180
|
+
const db = await getDb();
|
|
181
|
+
await db.collection("routes").updateOne({
|
|
178
182
|
projectId,
|
|
179
183
|
route
|
|
180
184
|
}, {
|