From 7110f30e16609c6a6c487df600692c8e605716be Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 14 May 2026 17:08:12 +0200 Subject: [PATCH] fix: top-friends returns usernames not UUIDs --- crates/presentation/src/handlers/social.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/presentation/src/handlers/social.rs b/crates/presentation/src/handlers/social.rs index 262c0e6..3946eb0 100644 --- a/crates/presentation/src/handlers/social.rs +++ b/crates/presentation/src/handlers/social.rs @@ -99,9 +99,6 @@ pub async fn get_top_friends_handler( ) -> Result, ApiError> { let user = get_user_by_username(&*s.users, &username).await?; let friends = get_top_friends(&*s.top_friends, &user.id).await?; - let ids: Vec = friends - .iter() - .map(|(tf, _)| tf.friend_id.as_uuid()) - .collect(); - Ok(Json(serde_json::json!({ "top_friends": ids }))) + let usernames: Vec<&str> = friends.iter().map(|(_, u)| u.username.as_str()).collect(); + Ok(Json(serde_json::json!({ "topFriends": usernames }))) }