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');
}).reduce((acc, stat) => {
const statSource = stat.source ?? '';
const existingSource = acc.find(s => s.source === statSource);
const existingSource = acc.find(s => s.source.toLowerCase() === statSource.toLowerCase());
if (existingSource) {
existingSource.signups += stat.signups || 0;
existingSource.paidConversions += stat.paidConversions || 0;