Skip to content

Commit

Permalink
fix selead variables breaking cli (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
Milo123459 authored Feb 4, 2025
1 parent 942cd28 commit 8a57be4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/controllers/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ pub async fn get_service_variables(
let variables = response
.variables_for_service_deployment
.into_iter()
.filter_map(|var| {
if let Some(value) = var.1 {
Some((var.0, value))
} else {
None
}
})
.collect();

Ok(variables)
Expand Down
5 changes: 3 additions & 2 deletions src/gql/queries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use graphql_client::GraphQLQuery;
use serde::{Deserialize, Serialize};

type DateTime = chrono::DateTime<chrono::Utc>;
type EnvironmentVariables = std::collections::BTreeMap<String, String>;
type EnvironmentVariables = std::collections::BTreeMap<String, Option<String>>;

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -109,7 +109,8 @@ pub struct UserProjects;
#[graphql(
schema_path = "src/gql/schema.json",
query_path = "src/gql/queries/strings/VariablesForServiceDeployment.graphql",
response_derives = "Debug, Serialize, Clone"
response_derives = "Debug, Serialize, Clone",
skip_serializing_none
)]
pub struct VariablesForServiceDeployment;

Expand Down

0 comments on commit 8a57be4

Please sign in to comment.