diff --git a/src/main.rs b/src/main.rs index d94eda9..a6ba576 100644 --- a/src/main.rs +++ b/src/main.rs @@ -177,6 +177,13 @@ async fn list_of_games(games: web::Data>>>) -> impl Responde .body(games_json) } +#[post("/admin/game/{game_code}")] +async fn update_game(pool: web::Data, form: web::Form) -> impl Responder { + db::update_game(&pool, form.into_inner()).await.unwrap(); + + HttpResponse::Ok() +} + #[post("/admin/query")] async fn admin_query(pool: web::Data, form: web::Form) -> impl Responder { let res: String; @@ -203,7 +210,7 @@ async fn main() -> std::io::Result<()> { games: state.clone(), } .start(); - sync_scores(actor_addr.clone()).await; + //sync_scores(actor_addr.clone()).await; HttpServer::new(move || { App::new() .app_data(web::Data::new(pool.clone()))