fix(score): fix score calculation synchronisation with rating being generated

This commit is contained in:
Daniel Klein 2024-09-18 21:16:35 +02:00
parent 6830e499cd
commit 6f70344af4

View file

@ -60,9 +60,9 @@ export const useData = defineStore('data', () => {
features: Feature[]
ranks: Rank[]
}>('/api/data')
data.projects.forEach(project => project.ratings = generateProjectRating(project))
projects.value = data.projects.map(project => ({
...project,
ratings: generateProjectRating(project),
percentage: Math.round((project.ratings?.reduce((a, b) => a + b.points, 0) || 0) / 1.5),
})).filter(p => p.name)