From c36a5bbaebbf1cb085cdd4ebeae6af841f7b5320 Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Tue, 10 May 2022 18:05:10 +0200 Subject: [PATCH] Fixed paidMembersByCadence always having keys refs https://github.com/TryGhost/Team/issues/1601 When there is no data in the backend, no keys are added. --- ghost/admin/app/services/dashboard-stats.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/services/dashboard-stats.js b/ghost/admin/app/services/dashboard-stats.js index f3102c8ca3..ed2776e24d 100644 --- a/ghost/admin/app/services/dashboard-stats.js +++ b/ghost/admin/app/services/dashboard-stats.js @@ -344,7 +344,10 @@ export default class DashboardStatsService extends Service { let statsUrl = this.ghostPaths.url.api('stats/subscriptions'); let result = yield this.ajax.request(statsUrl); - const paidMembersByCadence = {}; + const paidMembersByCadence = { + month: 0, + year: 0 + }; for (const cadence of result.meta.cadences) { paidMembersByCadence[cadence] = result.meta.totals.reduce((sum, total) => {