fixed
This commit is contained in:
@@ -126,9 +126,24 @@ pub async fn post_table_data(
|
|||||||
.map_err(|e| Status::invalid_argument(e.to_string()))?;
|
.map_err(|e| Status::invalid_argument(e.to_string()))?;
|
||||||
|
|
||||||
// Get source column from operation
|
// Get source column from operation
|
||||||
let source_column = match operation {
|
let source_column =
|
||||||
ScriptOperation::SetToColumn { source } => source,
|
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
|
// Check source column presence
|
||||||
let source_value = data.get(&source_column)
|
let source_value = data.get(&source_column)
|
||||||
|
|||||||
Reference in New Issue
Block a user