Skip to content

Commit 4ebb949

Browse files
authored
fix(analytics): count inbound follows instead of outbound in totalFollows (#448)
1 parent 01e038d commit 4ebb949

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/backend/src/routes/analytics.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export async function analyticsRoutes(
1919
_reply: FastifyReply
2020
) => {
2121
const userId = (request.user as any).id;
22+
const username = (request.user as any).username;
2223

2324
const today = new Date();
2425
today.setHours(0, 0, 0, 0);
@@ -40,7 +41,7 @@ export async function analyticsRoutes(
4041
// Follows performed BY this user
4142
app.prisma.followLog.count({
4243
where: {
43-
followerId: userId,
44+
targetUsername: username,
4445
status: 'success',
4546
},
4647
}),

0 commit comments

Comments
 (0)