diff --git a/src/apps.js b/src/apps.js index 61798f792..828d5fa5e 100644 --- a/src/apps.js +++ b/src/apps.js @@ -4,7 +4,7 @@ exports = module.exports = { AppsError: AppsError, hasAccessTo: hasAccessTo, - removeInternalAppFields: removeInternalAppFields, + removeInternalFields: removeInternalFields, get: get, getByIpAddress: getByIpAddress, @@ -324,7 +324,7 @@ function getAppConfig(app) { }; } -function removeInternalAppFields(app) { +function removeInternalFields(app) { return _.pick(app, 'id', 'appStoreId', 'installationState', 'installationProgress', 'runState', 'health', 'location', 'domain', 'fqdn', 'mailboxName', diff --git a/src/routes/apps.js b/src/routes/apps.js index 1f3fe47e7..66e57cb71 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -50,7 +50,7 @@ function getApp(req, res, next) { if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app')); if (error) return next(new HttpError(500, error)); - next(new HttpSuccess(200, apps.removeInternalAppFields(app))); + next(new HttpSuccess(200, apps.removeInternalFields(app))); }); } @@ -60,7 +60,7 @@ function getApps(req, res, next) { apps.getAll(function (error, allApps) { if (error) return next(new HttpError(500, error)); - allApps = allApps.map(apps.removeInternalAppFields); + allApps = allApps.map(apps.removeInternalFields); next(new HttpSuccess(200, { apps: allApps })); }); @@ -72,7 +72,7 @@ function getAllByUser(req, res, next) { apps.getAllByUser(req.user, function (error, allApps) { if (error) return next(new HttpError(500, error)); - allApps = allApps.map(apps.removeInternalAppFields); + allApps = allApps.map(apps.removeInternalFields); next(new HttpSuccess(200, { apps: allApps })); });