Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions server/src/handlers/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ pub async fn get_project(
) -> Result<Json<serde_json::Value>, (StatusCode, String)> {

// 1. Load project + security metadata (case-insensitive for username/slug)
let row_result = sqlx::query_as::<_, (i64, String, String, String, i64, Option<String>)>(
"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<String>, i64)>(
"SELECT image_tag, markdown, shell, owner_id, embed_key, id \
FROM projects \
WHERE LOWER(owner_username) = LOWER($1) AND LOWER(slug) = LOWER($2)"
)
Expand All @@ -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())),
};
Expand Down