Add stub function for game update endpoint
This commit is contained in:
@ -177,6 +177,13 @@ async fn list_of_games(games: web::Data<Arc<Mutex<Vec<Game>>>>) -> impl Responde
|
||||
.body(games_json)
|
||||
}
|
||||
|
||||
#[post("/admin/game/{game_code}")]
|
||||
async fn update_game(pool: web::Data<Pool>, form: web::Form<Game>) -> impl Responder {
|
||||
db::update_game(&pool, form.into_inner()).await.unwrap();
|
||||
|
||||
HttpResponse::Ok()
|
||||
}
|
||||
|
||||
#[post("/admin/query")]
|
||||
async fn admin_query(pool: web::Data<Pool>, form: web::Form<QueryForm>) -> 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()))
|
||||
|
||||
Reference in New Issue
Block a user