get method passing without any problem

This commit is contained in:
filipriec
2025-06-25 09:44:38 +02:00
parent f87e3c03cb
commit 5c23f61a10
3 changed files with 1133 additions and 4 deletions

View File

@@ -66,11 +66,11 @@ pub async fn get_table_data(
.await
.map_err(|e| Status::internal(format!("Foreign key lookup error: {}", e)))?;
// 2. Build the list of foreign key column names
// 2. Build the list of foreign key column names using full table names
let mut foreign_key_columns = Vec::new();
for fk in fk_columns_query {
let base_name = fk.table_name.split_once('_').map_or(fk.table_name.as_str(), |(_, rest)| rest);
foreign_key_columns.push(format!("{}_id", base_name));
// Use the full table name, not a stripped version
foreign_key_columns.push(format!("{}_id", fk.table_name));
}
// 3. Prepare a complete list of all columns to select