fix: top-friends returns usernames not UUIDs
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m40s
test / unit (pull_request) Successful in 16m13s
test / integration (pull_request) Failing after 17m12s

This commit is contained in:
2026-05-14 17:08:12 +02:00
parent aadd876994
commit 7110f30e16

View File

@@ -99,9 +99,6 @@ pub async fn get_top_friends_handler(
) -> Result<Json<serde_json::Value>, 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<Uuid> = 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 })))
}