Fixed mercure integration

This commit is contained in:
Alejandro Celaya 2022-11-11 16:51:21 +01:00
parent ed4c03f154
commit d90f6c2019

View file

@ -49,10 +49,13 @@ const increaseVisitsForTags = (tags: TagIncrease[], stats: TagsStatsMap) => tags
const tagStats = theStats[tag];
tagStats.visitsCount += increase;
theStats[tag] = tagStats; // eslint-disable-line no-param-reassign
return theStats;
return {
...theStats,
[tag]: {
...tagStats,
visitsCount: tagStats.visitsCount + increase,
},
};
}, { ...stats });
const calculateVisitsPerTag = (createdVisits: CreateVisit[]): TagIncrease[] => Object.entries(
createdVisits.reduce<Stats>((acc, { shortUrl }) => {