@smbcloud / cli / commits / c838251

fix project fields requirement

Seto Elkahfi committed May 29, 2025 at 02:03 UTC c838251fc453e652bebfb44afb1649d71cae594c
3 files changed +8 -9
crates/cli/src/deploy/config.rs
+2 -7
@@ -3,6 +3,7 @@ use std::{fs, path::Path};
3 use crate::ui::{fail_message, fail_symbol, succeed_message, succeed_symbol};
4 use git2::{Cred, CredentialType, Error};
5 use serde::Deserialize;
6 +use smbcloud_model::project::Project;
7 use smbcloud_networking::environment::Environment;
8 use smbcloud_networking_project::get_project;
9 use spinners::Spinner;
@@ -66,16 +67,10 @@ pub(crate) async fn check_project(env: Environment, id: i32) -> Result<(), Confi
67 #[derive(Deserialize)]
68 pub struct Config {
69 pub name: String,
69 - pub description: String,
70 + pub description: Option<String>,
71 pub project: Project,
72 }
73
73 -#[derive(Deserialize)]
74 -pub struct Project {
75 - pub id: i32,
76 - pub repository: String,
77 -}
78 -
74 impl Config {
75 pub fn credentials(
76 &self,
crates/cli/src/project/crud_read.rs
+4 -1
@@ -15,6 +15,8 @@ struct ProjectRow {
15 id: i32,
16 #[tabled(rename = "Name")]
17 name: String,
18 + #[tabled(rename = "Repository")]
19 + repository: String,
20 #[tabled(rename = "Description")]
21 description: String,
22 #[tabled(rename = "Created at")]
@@ -93,7 +95,8 @@ pub(crate) fn show_projects(projects: Vec<Project>) {
95 .map(|p| ProjectRow {
96 id: p.id,
97 name: p.name,
96 - description: p.description,
98 + repository: p.repository,
99 + description: p.description.unwrap_or("-".to_owned()),
100 created_at: p.created_at.date_naive().to_string(),
101 updated_at: p.updated_at.date_naive().to_string(),
102 })
crates/smbcloud-model/src/project.rs
+2 -1
@@ -13,7 +13,8 @@ pub struct Config {
13 pub struct Project {
14 pub id: i32,
15 pub name: String,
16 - pub description: String,
16 + pub repository: String,
17 + pub description: Option<String>,
18 #[serde(with = "ar_date_format")]
19 pub created_at: DateTime<Utc>,
20 #[serde(with = "ar_date_format")]