0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed analytics sources to not be case sensitive (#20506)

fixes
https://linear.app/tryghost/issue/ENG-925/analytics-sources-shouldnt-be-case-sensitive
This commit is contained in:
Princi Vershwal 2024-07-02 12:17:13 +05:30 committed by GitHub
parent 9522ef8ca8
commit e6b1f8a8bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -250,7 +250,7 @@ export default class DashboardStatsService extends Service {
return stat.date >= moment().add(-this.chartDays, 'days').format('YYYY-MM-DD'); return stat.date >= moment().add(-this.chartDays, 'days').format('YYYY-MM-DD');
}).reduce((acc, stat) => { }).reduce((acc, stat) => {
const statSource = stat.source ?? ''; const statSource = stat.source ?? '';
const existingSource = acc.find(s => s.source === statSource); const existingSource = acc.find(s => s.source.toLowerCase() === statSource.toLowerCase());
if (existingSource) { if (existingSource) {
existingSource.signups += stat.signups || 0; existingSource.signups += stat.signups || 0;
existingSource.paidConversions += stat.paidConversions || 0; existingSource.paidConversions += stat.paidConversions || 0;