@smbcloud / cli / commits / 973f64f

Fix parsing

keypair34 committed Aug 1, 2026 at 17:24 UTC 973f64f828555d4d5805905bed9e9678012323fe
2 files changed +10 -3
crates/cli/src/cloud-auth/render.rs
+6 -2
@@ -28,7 +28,9 @@ pub(crate) fn print_auth_apps(auth_apps: &[AuthApp]) {
28 "#{} {} project={}",
29 auth_app.id,
30 style(&auth_app.name).bold(),
31 - auth_app.project_id.as_deref().unwrap_or("-")
31 + auth_app
32 + .project_id
33 + .map_or_else(|| "-".to_string(), |id| id.to_string())
34 );
35 }
36 }
@@ -37,7 +39,9 @@ pub(crate) fn print_auth_app_detail(auth_app: &AuthApp) {
39 print_heading("Auth app");
40 print_field("ID", &auth_app.id);
41 print_field("Name", &auth_app.name);
40 - print_optional_field("Project ID", auth_app.project_id.as_deref());
42 + if let Some(project_id) = auth_app.project_id {
43 + print_field("Project ID", project_id.to_string());
44 + }
45 print_optional_field("Support email", auth_app.support_email.as_deref());
46 print_optional_field("Secret", auth_app.secret.as_deref());
47 print_field("Created at", auth_app.created_at.to_rfc3339());
crates/smbcloud-model/src/app_auth.rs
+4 -1
@@ -8,7 +8,10 @@ pub struct AuthApp {
8 pub id: String,
9 pub secret: Option<String>,
10 pub name: String,
11 - pub project_id: Option<String>,
11 + // Serialized as a number by the API, like `Deployment`/`MailApp`. The
12 + // create/update payloads take it as a String because it comes from a CLI
13 + // arg — the two are intentionally different types.
14 + pub project_id: Option<i32>,
15 pub support_email: Option<String>,
16 #[serde(with = "ar_date_format")]
17 pub created_at: DateTime<Utc>,