diff --git a/src/v3/mod.rs b/src/v3/mod.rs index 3e4c361..53122c3 100644 --- a/src/v3/mod.rs +++ b/src/v3/mod.rs @@ -986,12 +986,10 @@ pub(crate) async fn edit_empire( let mut db_empire_query = QueryBuilder::::new("UPDATE public.empires SET "); let mut db_empire_separated = db_empire_query.separated(", "); - if let Some(new_game) = params.game_id { - any_param_present = true; - db_empire_separated - .push(" game_id = ") - .push_bind_unseparated(new_game); - } + // More often than not does nothing but is required to ensure data is handled properly + db_empire_separated + .push(" game_id = ") + .push_bind_unseparated(params.game_id); if let Some(new_group) = params.group_id { any_param_present = true; @@ -1045,9 +1043,6 @@ pub(crate) async fn edit_empire( db_empire_separated .push_unseparated(" WHERE id = ") .push_bind_unseparated(params.empire_id); - db_empire_separated - .push_unseparated(" AND group_id = ") - .push_bind_unseparated(params.group_id); db_empire_separated .push_unseparated(" AND game_id = ") .push_bind_unseparated(params.game_id); @@ -1070,9 +1065,6 @@ pub(crate) async fn edit_empire( db_empire_separated .push_unseparated(" WHERE id = ") .push_bind_unseparated(params.empire_id); - db_empire_separated - .push_unseparated(" AND group_id = ") - .push_bind_unseparated(params.group_id); db_empire_separated .push_unseparated(" AND game_id = ") .push_bind_unseparated(params.game_id); @@ -1284,9 +1276,6 @@ pub(crate) async fn get_ethics(data: web::Data) -> impl Responder { responses( (status = 200, description = "OK", body = ChellarisPhenotypes), ), - security( - ("api_key" = []) - ), )] #[get("/api/v3/phenotypes")] pub(crate) async fn get_phenotypes(data: web::Data) -> impl Responder { diff --git a/src/v3/schemas.rs b/src/v3/schemas.rs index df628d7..847bccc 100644 --- a/src/v3/schemas.rs +++ b/src/v3/schemas.rs @@ -147,7 +147,7 @@ pub struct UpdateEmpireParams { #[schema(example = 1)] pub empire_id: i32, #[schema(example = 1)] - pub game_id: Option, + pub game_id: i32, #[schema(example = 1)] pub group_id: Option, #[schema(example = "Example Empire")]