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:
parent
4c454d5d08
commit
fbb0445942
@ -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));
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user