From fbb04459425772daba014a8ff6033eb8f74897cc Mon Sep 17 00:00:00 2001 From: sveisvei Date: Fri, 9 Dec 2016 22:03:25 +0100 Subject: [PATCH] inject metadata on toplevel --- lib/routes/metrics.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/routes/metrics.js b/lib/routes/metrics.js index d618aca4c4..3afb81b320 100644 --- a/lib/routes/metrics.js +++ b/lib/routes/metrics.js @@ -28,7 +28,7 @@ module.exports = function (app, config) { Object.keys(seenApps).forEach(key => { seenApps[key] = seenApps[key].map(entry => { if (metaData[entry.appName]) { - entry.data = metaData[entry.appName]; + return Object.assign({}, entry, metaData[entry.appName]); } return entry; }); @@ -118,17 +118,7 @@ module.exports = function (app, config) { app.get('/client/applications/', (req, res) => { clientApplicationsStore .getApplications(req.query) - .then(apps => { - const applications = apps.map(({ appName, createdAt, strategies }) => ({ - appName, - strategies, - createdAt, - links: { - appDetails: `/api/client/applications/${appName}`, - }, - })); - res.json({ applications }); - }) + .then(applications => res.json({ applications })) .catch(err => catchLogAndSendErrorResponse(err, res)); });