Merge pull request #733 from acelaya-forks/feature/fix-mercure-integration

Fixed mercure integration
This commit is contained in:
Alejandro Celaya 2022-11-11 16:57:40 +01:00 committed by GitHub
commit a1d869900b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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