This commit is contained in:
filipriec
2025-03-08 16:30:10 +01:00
parent 4a43097773
commit 9396a08af0

View File

@@ -126,8 +126,23 @@ pub async fn post_table_data(
.map_err(|e| Status::invalid_argument(e.to_string()))?;
// Get source column from operation
let source_column = match operation {
ScriptOperation::SetToColumn { source } => source,
let source_column =
match operation {
ScriptOperation::SetToLocalColumn { source } => source,
ScriptOperation::SetToExternalColumn { table, column } => {
// For external columns, we need to resolve the value from the external table
let external_source = format!("@{}.{}", table, column);
let resolved_value = execution::resolve_value(
db_pool,
profile_id,
&table_name,
&data,
&external_source
).await.map_err(|e| Status::invalid_argument(e.to_string()))?;
// Return the resolved value
resolved_value
}
};
// Check source column presence