Skip to content

Commit

Permalink
Deprecate old tables and switch over the rust ones
Browse files Browse the repository at this point in the history
  • Loading branch information
aviguptatx committed Apr 11, 2024
1 parent 38e87e7 commit 5873fa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub async fn fetch_usernames_sorted_by_elo(
client: &Postgrest,
) -> Result<Vec<String>, Box<dyn Error>> {
let body = client
.from("all")
.from("all_rust")
.select("username")
.order("elo.desc")
.execute()
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
}

async fn handle_index<T>(ctx: &RouteContext<T>, client: &Postgrest) -> Result<Response> {
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}"))?;

Expand Down

0 comments on commit 5873fa4

Please sign in to comment.