From 8117c5bcd597802f7631281acf457b230544897c Mon Sep 17 00:00:00 2001 From: Srejoye Date: Mon, 1 Jun 2026 22:23:29 +0530 Subject: [PATCH] fix(analytics): count inbound follows instead of outbound in totalFollows --- apps/backend/src/routes/analytics.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/backend/src/routes/analytics.ts b/apps/backend/src/routes/analytics.ts index a2615cf8..a975424f 100644 --- a/apps/backend/src/routes/analytics.ts +++ b/apps/backend/src/routes/analytics.ts @@ -19,6 +19,7 @@ export async function analyticsRoutes( _reply: FastifyReply ) => { const userId = (request.user as any).id; + const username = (request.user as any).username; const today = new Date(); today.setHours(0, 0, 0, 0); @@ -40,7 +41,7 @@ export async function analyticsRoutes( // Follows performed BY this user app.prisma.followLog.count({ where: { - followerId: userId, + targetUsername: username, status: 'success', }, }),