Ajoute l'URL du repo sur les projets

Colonne projects.repo_url (migration 0003), exposée par l'API
(repo_url à la création, "" ou null pour l'effacer) et éditable sur la
page clients ; une icône ouvre le repo dans un nouvel onglet. Seules les
URL http(s) sont acceptées.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Romulus21andClaude Opus 5.5 committed 2026-11-13 18:59:20 +01:00
1 parent 9e136bd208
commit 63ddfd39d9
11 files changed
+126 -8

No files matched your search

+10 -1
View File
@@ -90,7 +90,16 @@ async fn create_project(
) -> AppResult<(StatusCode, Json<Project>)> {
Ok((
StatusCode::CREATED,
Json(projects::create(&pool, client_id, &input.name, input.color.as_deref()).await?),
Json(
projects::create(
&pool,
client_id,
&input.name,
input.color.as_deref(),
input.repo_url.as_deref(),
)
.await?,
),
))
}
+12 -1
View File
@@ -417,6 +417,9 @@ struct ItemForm {
/// Projects only: go back to the client's color.
#[serde(default)]
inherit: bool,
/// Projects only; blank removes it.
#[serde(default)]
repo_url: Option<String>,
}
#[derive(Deserialize)]
@@ -476,7 +479,14 @@ async fn create_project(
// The color picker is prefilled with the client's color: keeping it means inheriting.
let client = clients::get(&pool, client_id).await?;
let color = f.color.filter(|c| !c.eq_ignore_ascii_case(&client.color));
projects::create(&pool, client_id, &f.name, color.as_deref()).await?;
projects::create(
&pool,
client_id,
&f.name,
color.as_deref(),
f.repo_url.as_deref(),
)
.await?;
back_to_clients()
}
@@ -497,6 +507,7 @@ async fn save_project(
let input = UpdateInput {
name: Some(f.name),
color,
repo_url: f.repo_url.map(Some),
..Default::default()
};
projects::update(&pool, id, &input).await?;