From df6aecef518ad30e2f33ef76503ad0149b5b86b3 Mon Sep 17 00:00:00 2001 From: mathieu Date: Sat, 16 May 2026 01:55:35 +0200 Subject: [PATCH] fix(repository): add missing name column in find_network query The sed replacement during the network name feature didn't update find_network's SELECT, causing a ColumnNotFound panic on host creation. Co-Authored-By: Claude Sonnet 4.6 --- src/server/repository/networks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/repository/networks.rs b/src/server/repository/networks.rs index c138d30..2009b0f 100644 --- a/src/server/repository/networks.rs +++ b/src/server/repository/networks.rs @@ -23,7 +23,7 @@ pub async fn list_networks(pool: &AnyPool) -> Result, DbError> { pub async fn find_network(pool: &AnyPool, id: i64) -> Result, DbError> { // `fetch_optional` returns `Ok(None)` when no row matches — unlike // `fetch_one`, which returns an error when nothing is found. - let row = sqlx::query("SELECT id, cidr FROM networks WHERE id = $1") + let row = sqlx::query("SELECT id, name, cidr FROM networks WHERE id = $1") .bind(id) // `$1` is replaced with the value of `id` at runtime .fetch_optional(pool) .await?;