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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user