fix: resolve React key duplicates and NaN in profile page

- Fix NaN error in impact score calculation by handling undefined reportCount/eventCount
- Fix duplicate React keys in activity timeline by using unique composite keys
- Add reportCount and eventCount to backend profile response to match frontend expectations
- Keep stats object for backward compatibility

Fixes:
- 'Received NaN for children attribute' warning
- 'Encountered two children with the same key' errors
This commit is contained in:
2025-11-16 21:46:40 +00:00
parent 701735a7e4
commit ad06833842
2 changed files with 7 additions and 3 deletions

View File

@@ -98,6 +98,8 @@ export class UserService {
return {
...user,
reportCount: user._count.reports,
eventCount: user._count.eventRegistrations,
stats: {
reportsSubmitted: user._count.reports,
eventsAttended: user._count.eventRegistrations,