Skip to content

Commit 433d081

Browse files
authoredMar 29, 2024
add includeDisabled to list all zones (#33)
* add includeDisabled to list all zones * fix searching * add catch * remove if(err)
1 parent 6882465 commit 433d081

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed
 

‎lib/handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function fetchCounters(zones, callback) {
107107

108108
function fetchZoneList(callback) {
109109
request(
110-
config.apiServer + '/zones',
110+
config.apiServer + '/zones?includeDisabled=true',
111111
{
112112
json: true
113113
},

‎routes/index.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,7 @@ router.get('/find', (req, res, next) => {
405405
opts.previous = cursorValue;
406406
}
407407

408-
MongoPaging.find(db.client.collection('mids'), opts, (err, result) => {
409-
if (err) {
410-
return next(err);
411-
}
412-
408+
MongoPaging.find(db.client.collection('mids'), opts).then((result) => {
413409
if (!result.hasPrevious) {
414410
page = 1;
415411
}
@@ -433,7 +429,7 @@ router.get('/find', (req, res, next) => {
433429
time: entry.t.toISOString()
434430
}))
435431
});
436-
});
432+
}).catch(next);
437433
});
438434
});
439435

0 commit comments

Comments
 (0)
Please sign in to comment.