From 1b7c882852256a0a7495746f10ebbfdbe9719d11 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Sat, 10 Jan 2026 15:33:21 +0100 Subject: [PATCH] fix: relationshipsSelf are now actually self --- src/api/routes/users/#user_id/profile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/users/#user_id/profile.ts b/src/api/routes/users/#user_id/profile.ts index c4a7a2efb..ec7528a18 100644 --- a/src/api/routes/users/#user_id/profile.ts +++ b/src/api/routes/users/#user_id/profile.ts @@ -100,7 +100,7 @@ router.get("/", route({ responses: { 200: { body: "UserProfileResponse" } } }), let mutual_friends_count = 0; if (with_mutual_friends == "true" || with_mutual_friends_count == "true") { - const relationshipsSelf = await Relationship.find({ where: { from_id: user_id, type: RelationshipType.friends } }); + const relationshipsSelf = await Relationship.find({ where: { from_id: req.user_id, type: RelationshipType.friends } }); const relationshipsUser = await Relationship.find({ where: { from_id: user_id, type: RelationshipType.friends } }); const relationshipsIntersection = relationshipsSelf.filter((r1) => relationshipsUser.some((r2) => r2.to_id === r1.to_id)); if (with_mutual_friends_count) mutual_friends_count = relationshipsIntersection.length;