summary refs log tree commit diff
diff options
context:
space:
mode:
authorCyber <cyber.hf18@gmail.com>2026-01-10 15:42:45 +0100
committerGitHub <noreply@github.com>2026-01-10 15:42:45 +0100
commitcaec0d23203971da2686056241e6bddec9296809 (patch)
tree100b17528022b09bcc35bc748282f66bcc81b486
parentUpdate nix (diff)
parentfix: relationshipsSelf are now actually self (diff)
downloadserver-ts-caec0d23203971da2686056241e6bddec9296809.tar.xz
Merge pull request #1463 from CyberL1/fix/mutual-friends
-rw-r--r--src/api/routes/users/#user_id/profile.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/routes/users/#user_id/profile.ts b/src/api/routes/users/#user_id/profile.ts

index c4a7a2ef..ec7528a1 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;