feat: update JSON keys in user profile and top friends API for consistency

This commit is contained in:
2025-09-06 22:04:38 +02:00
parent 85e3425d4b
commit bf7c6501c6
3 changed files with 13 additions and 10 deletions

View File

@@ -132,7 +132,10 @@ pub async fn update_user_profile(
pub async fn get_top_friends(db: &DbConn, user_id: Uuid) -> Result<Vec<user::Model>, DbErr> {
user::Entity::find()
.join(JoinType::InnerJoin, top_friends::Relation::User.def().rev())
.join(
JoinType::InnerJoin,
top_friends::Relation::Friend.def().rev(),
)
.filter(top_friends::Column::UserId.eq(user_id))
.order_by_asc(top_friends::Column::Position)
.all(db)