mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(executor/function): fix resolution of tag inputs to function block
This commit is contained in:
@@ -494,6 +494,21 @@ export class Executor {
|
||||
}
|
||||
|
||||
if (blockType === 'condition') {
|
||||
if (output && typeof output === 'object' && 'response' in output) {
|
||||
return {
|
||||
response: {
|
||||
...output.response,
|
||||
conditionResult: output.response.conditionResult || false,
|
||||
selectedPath: output.response.selectedPath || {
|
||||
blockId: '',
|
||||
blockType: '',
|
||||
blockTitle: '',
|
||||
},
|
||||
selectedConditionId: output.response.selectedConditionId || '',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
response: {
|
||||
conditionResult: output?.conditionResult || false,
|
||||
|
||||
@@ -223,6 +223,9 @@ export class InputResolver {
|
||||
|
||||
if (currentBlock.metadata?.id === 'condition') {
|
||||
formattedValue = this.stringifyForCondition(replacementValue)
|
||||
} else if (currentBlock.metadata?.id === 'function' && typeof replacementValue === 'string') {
|
||||
// For function blocks, we need to properly quote string values to avoid syntax errors
|
||||
formattedValue = JSON.stringify(replacementValue)
|
||||
} else {
|
||||
formattedValue =
|
||||
typeof replacementValue === 'object'
|
||||
|
||||
Reference in New Issue
Block a user