Environment Variables: renaming overrideConfig node to envVars

This commit is contained in:
vinodkiran
2023-12-12 22:22:25 +05:30
parent 790c7eabeb
commit ef3f1b34b1
2 changed files with 4 additions and 8 deletions
@@ -85,16 +85,16 @@ class CustomTool_Tools implements INode {
// override variables defined in overrideConfig
// nodeData.inputs.variables is an Object, check each property and override the variable
if (nodeData?.inputs?.variables) {
for (const propertyName of Object.getOwnPropertyNames(nodeData.inputs.variables)) {
if (nodeData?.inputs?.envVars) {
for (const propertyName of Object.getOwnPropertyNames(nodeData.inputs.envVars)) {
const foundVar = variables.find((v) => v.name === propertyName)
if (foundVar) {
// even if the variable was defined as runtime, we override it with static value
foundVar.type = 'static'
foundVar.value = nodeData.inputs.variables[propertyName]
foundVar.value = nodeData.inputs.envVars[propertyName]
} else {
// add it the variables, if not found locally in the db
variables.push({ name: propertyName, type: 'static', value: nodeData.inputs.variables[propertyName] })
variables.push({ name: propertyName, type: 'static', value: nodeData.inputs.envVars[propertyName] })
}
}
}
-4
View File
@@ -1382,10 +1382,6 @@ export class App {
const chatflowid = req.params.id
let incomingInput: IncomingInput = req.body
if (incomingInput.question) {
incomingInput.question = await replaceEnvVariables(incomingInput.question, this.AppDataSource)
}
let nodeToExecuteData: INodeData
const chatflow = await this.AppDataSource.getRepository(ChatFlow).findOneBy({