1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00

inject metadata on toplevel

This commit is contained in:
sveisvei 2016-12-09 22:03:25 +01:00
parent 4c454d5d08
commit fbb0445942

View File

@ -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));
});