displaying data properly, fixing hardcoded backend to firma part one

This commit is contained in:
filipriec
2025-06-07 14:05:35 +02:00
parent 08e01d41f2
commit 387e1a0fe0
10 changed files with 101 additions and 119 deletions

View File

@@ -56,7 +56,6 @@ pub async fn get_table_data(
let system_columns = vec![
("id".to_string(), "BIGINT".to_string()),
("deleted".to_string(), "BOOLEAN".to_string()),
("firma".to_string(), "TEXT".to_string()),
];
let all_columns: Vec<(String, String)> = system_columns
.into_iter()

View File

@@ -19,19 +19,11 @@ pub async fn post_table_data(
let table_name = request.table_name;
let mut data = HashMap::new();
// Process and validate all data values
// CORRECTED: Process and trim all incoming data values.
// We remove the hardcoded validation. We will let the database's
// NOT NULL constraints or Steel validation scripts handle required fields.
for (key, value) in request.data {
let trimmed = value.trim().to_string();
// Handle specially - it cannot be empty
if trimmed.is_empty() {
return Err(Status::invalid_argument("Firma cannot be empty"));
}
// Add trimmed non-empty values to data map
if !trimmed.is_empty() {
data.insert(key, trimmed);
}
data.insert(key, value.trim().to_string());
}
// Lookup profile