Skip to content

Commit

Permalink
fix username/country order in user stats api response
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jul 20, 2024
1 parent 8256413 commit e0d8477
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/routes/reworks/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async fn get_rework_stats(

let stats = stats.unwrap();

let user_info: (String, String) =
let (username, user_country): (String, String) =
sqlx::query_as("SELECT username, country FROM users WHERE id = ?")
.bind(user_id)
.fetch_one(ctx.database.get().await?.deref_mut())
Expand Down Expand Up @@ -133,8 +133,8 @@ async fn get_rework_stats(

let api_user = APIReworkStats::from_stats(
stats,
user_info.0,
user_info.1,
user_country,
username,
(old_rank_idx.unwrap_or(-1) + 1) as u64,
(new_rank_idx.unwrap_or(-1) + 1) as u64,
);
Expand Down

0 comments on commit e0d8477

Please sign in to comment.