displaying data properly, fixing hardcoded backend to firma part one
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user