From f190fee1df638d6ea9ce78d98e15bd8e7d8474e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 04:58:47 +0000 Subject: [PATCH 1/2] Initial plan From d89d045a62dddd693c07811eabed4167def94714 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 05:12:09 +0000 Subject: [PATCH 2/2] Reorder query fields to add 'id' at the end for maintainability Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com> --- server/src/handlers/project.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/handlers/project.rs b/server/src/handlers/project.rs index df7fd97..8306236 100644 --- a/server/src/handlers/project.rs +++ b/server/src/handlers/project.rs @@ -260,8 +260,9 @@ pub async fn get_project( ) -> Result, (StatusCode, String)> { // 1. Load project + security metadata (case-insensitive for username/slug) - let row_result = sqlx::query_as::<_, (i64, String, String, String, i64, Option)>( - "SELECT id, image_tag, markdown, shell, owner_id, embed_key \ + // Query returns: (image_tag, markdown, shell, owner_id, embed_key, id) + let row_result = sqlx::query_as::<_, (String, String, String, i64, Option, i64)>( + "SELECT image_tag, markdown, shell, owner_id, embed_key, id \ FROM projects \ WHERE LOWER(owner_username) = LOWER($1) AND LOWER(slug) = LOWER($2)" ) @@ -270,7 +271,7 @@ pub async fn get_project( .await .map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, format!("DB Read Error: {}", e)))?; - let (project_id, image_tag, markdown, shell, owner_id, mut embed_key) = match row_result { + let (image_tag, markdown, shell, owner_id, mut embed_key, project_id) = match row_result { Some(r) => r, None => return Err((StatusCode::NOT_FOUND, "Project not found".to_string())), };