diff --git a/forge/db/views/Project.js b/forge/db/views/Project.js index f124d5a65a..67e3308a8e 100644 --- a/forge/db/views/Project.js +++ b/forge/db/views/Project.js @@ -100,10 +100,13 @@ module.exports = function (app) { return result } + // This view is only used by the 'deprecated' /team/:teamId/projects end point. + // However it is still used in a few places from the frontend. None of them + // require the full details of the instances - so the settings object can be omitted async function instancesList (instancesArray) { return Promise.all(instancesArray.map(async (instance) => { - // Full settings are not - const result = await app.db.views.Project.project(instance, { includeSettings: true }) + // Full settings are not required for the instance summary list + const result = await app.db.views.Project.project(instance, { includeSettings: false }) if (!result.url) { delete result.url diff --git a/forge/routes/api/team.js b/forge/routes/api/team.js index bcd22922bf..2f368eebfd 100644 --- a/forge/routes/api/team.js +++ b/forge/routes/api/team.js @@ -331,7 +331,11 @@ module.exports = async function (app) { /** * @deprecated Use /:teamId/applications, or /:applicationId/instances - * This end-point is still used by the project nodes and nr-tools plugin. + * This end-point is still used by: + * - the project nodes and nr-tools plugin. + * - the Team Instances view + * - team/Devices/dialogs/CreateProvisionTokenDialog.vue + * - team/Settings/Devices.vue */ app.get('/:teamId/projects', { preHandler: app.needsPermission('team:projects:list')