From fdeaa4ff3ae31cb4b7adf2863526da927013f14b Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Sun, 16 Nov 2025 21:50:19 +0000 Subject: [PATCH] fix: only count attended events in profile statistics - Update getUserProfile to count only eventRegistrations where attended=true - This ensures 'Events Attended' shows actual attended events, not just registrations - Impact score calculation already had this logic and remains unchanged Now 'Events Attended' will only increment after an event is completed and marked as attended --- server/src/services/userService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/services/userService.ts b/server/src/services/userService.ts index f1ecb30..5821566 100644 --- a/server/src/services/userService.ts +++ b/server/src/services/userService.ts @@ -85,7 +85,9 @@ export class UserService { _count: { select: { reports: true, - eventRegistrations: true, + eventRegistrations: { + where: { attended: true }, + }, organizedEvents: true, }, },