fix: identities API - use real_name instead of name for cross-schema compatibility

This commit is contained in:
Accusys
2026-05-19 10:21:49 +08:00
parent 72f4b53357
commit 7b6da4f0d8
2 changed files with 23 additions and 30 deletions

View File

@@ -97,7 +97,7 @@ async fn create_identity(
reference_data->'angles_covered' as angles,
reference_data->'quality_avg' as quality
FROM identities
WHERE name = $1
WHERE real_name = $1
ORDER BY created_at DESC
LIMIT 1
"#;
@@ -168,7 +168,7 @@ async fn list_identities(
.fetch_one(db.pool()).await
.map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, format!("Count error: {}", e)))?;
let sql = format!("SELECT id, uuid, name, metadata FROM {} ORDER BY id DESC LIMIT $1 OFFSET $2", id_table);
let sql = format!("SELECT id::int, uuid, real_name, metadata FROM {} ORDER BY id DESC LIMIT $1 OFFSET $2", id_table);
let rows: Vec<(i32, uuid::Uuid, String, Option<serde_json::Value>)> = match sqlx::query_as(&sql)
.bind(page_size as i64)