diff --git a/lib/routes/admin-api/metrics.js b/lib/routes/admin-api/metrics.js index 77b4cdf094..6f7805c0d6 100644 --- a/lib/routes/admin-api/metrics.js +++ b/lib/routes/admin-api/metrics.js @@ -27,23 +27,24 @@ class MetricsController extends Controller { this.get('/applications/:appName', this.getApplication); } - getSeenToggles(req, res) { - const seenAppToggles = this.metrics.getAppsWithToggles(); + async getSeenToggles(req, res) { + const seenAppToggles = await this.metrics.getAppsWithToggles(); res.json(seenAppToggles); } async getSeenApps(req, res) { - const seenApps = this.metrics.getSeenApps(); + const seenApps = await this.metrics.getSeenApps(); res.json(seenApps); } - getFeatureToggles(req, res) { - res.json(this.metrics.getTogglesMetrics()); + async getFeatureToggles(req, res) { + const toggles = await this.metrics.getTogglesMetrics(); + res.json(toggles); } - getFeatureToggle(req, res) { + async getFeatureToggle(req, res) { const { name } = req.params; - const data = this.metrics.getTogglesMetrics(); + const data = await this.metrics.getTogglesMetrics(); const lastHour = data.lastHour[name] || {}; const lastMinute = data.lastMinute[name] || {}; res.json({