From aeed7537868a1c28bf0cac8ba124960dcacba5b6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 29 Oct 2020 11:48:01 +0000 Subject: [PATCH] Updating for review comments. --- packages/server/src/api/controllers/application.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/application.js b/packages/server/src/api/controllers/application.js index 0765d50f6d..66cde54fd6 100644 --- a/packages/server/src/api/controllers/application.js +++ b/packages/server/src/api/controllers/application.js @@ -49,11 +49,7 @@ async function createInstance(template) { exports.fetch = async function(ctx) { let allDbs = await CouchDB.allDbs() const appDbNames = allDbs.filter(dbName => dbName.startsWith(APP_PREFIX)) - const apps = [] - for (let dbName of appDbNames) { - const db = new CouchDB(dbName) - apps.push(db.get(dbName)) - } + const apps = appDbNames.map(db => new CouchDB(db).get(db)) if (apps.length === 0) { ctx.body = [] } else {