From e0d847705431304dc6dec1e8ff8a5744eac87183 Mon Sep 17 00:00:00 2001 From: cmyui Date: Sat, 20 Jul 2024 01:05:21 -0400 Subject: [PATCH] fix username/country order in user stats api response --- src/api/routes/reworks/user.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/routes/reworks/user.rs b/src/api/routes/reworks/user.rs index ede9d9c..af0a597 100644 --- a/src/api/routes/reworks/user.rs +++ b/src/api/routes/reworks/user.rs @@ -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()) @@ -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, );