diff --git a/src/database.rs b/src/database.rs index 6fb07f8..c71961b 100644 --- a/src/database.rs +++ b/src/database.rs @@ -85,7 +85,7 @@ pub async fn fetch_usernames_sorted_by_elo( client: &Postgrest, ) -> Result, Box> { let body = client - .from("all") + .from("all_rust") .select("username") .order("elo.desc") .execute() diff --git a/src/lib.rs b/src/lib.rs index 40bab1b..b73601f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,9 +67,9 @@ async fn main(req: Request, env: Env, _ctx: Context) -> Result { } async fn handle_index(ctx: &RouteContext, client: &Postgrest) -> Result { - let db_name = ctx.param("db_name").map_or("all", |str| str); + let db_name = ctx.param("db_name").map_or("all", |str| str).to_string() + "_rust"; - let data = fetch_leaderboard_from_db(db_name, client) + let data = fetch_leaderboard_from_db(&db_name, client) .await .map_err(|e| format!("Couldn't fetch leaderboard from database: {e}"))?;