mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
Fixed tiers without members not shown in paid mix chart
This commit is contained in:
parent
59a1b8a31f
commit
6ba9f6a3be
@ -366,6 +366,7 @@ export default class DashboardStatsService extends Service {
|
||||
const _tier = this.paidTiers.find(x => x.id === tier);
|
||||
paidMembersByTier.push({
|
||||
tier: {
|
||||
id: _tier.id,
|
||||
name: _tier.name
|
||||
},
|
||||
members: result.meta.totals.reduce((sum, total) => {
|
||||
@ -377,6 +378,19 @@ export default class DashboardStatsService extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
// Add all missing tiers without members
|
||||
for (const tier of this.paidTiers) {
|
||||
if (!paidMembersByTier.find(t => t.tier.id === tier.id)) {
|
||||
paidMembersByTier.push({
|
||||
tier: {
|
||||
id: tier.id,
|
||||
name: tier.name
|
||||
},
|
||||
members: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function mergeDates(list, entry) {
|
||||
const [current, ...rest] = list;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user