File tree Expand file tree Collapse file tree
packages/server/src/services/variables Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ const updateVariable = async (variable: Variable, updatedVariable: Variable) =>
104104 throw new InternalFlowiseError ( StatusCodes . BAD_REQUEST , 'Cloud platform does not support runtime variables!' )
105105 try {
106106 const tmpUpdatedVariable = await appServer . AppDataSource . getRepository ( Variable ) . merge ( variable , updatedVariable )
107- tmpUpdatedVariable . workspaceId = variable . workspaceId // defense-in-depth: never trust client-supplied workspaceId
107+ const originalWorkspaceId = variable . workspaceId ;
108+ const tmpUpdatedVariable = await appServer . AppDataSource . getRepository ( Variable ) . merge ( variable , updatedVariable ) ;
109+ tmpUpdatedVariable . workspaceId = originalWorkspaceId ;
108110 const dbResponse = await appServer . AppDataSource . getRepository ( Variable ) . save ( tmpUpdatedVariable )
109111 return dbResponse
110112 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments