Skip to content

Commit aef5b3b

Browse files
author
christopherholland-workday
committed
Fix Mass Assignment in Variables Endpoints
1 parent d6fa990 commit aef5b3b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • packages/server/src/services/variables

packages/server/src/services/variables/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ const updateVariable = async (variable: Variable, updatedVariable: Variable) =>
103103
if (appServer.identityManager.getPlatformType() === Platform.CLOUD && updatedVariable.type === 'runtime')
104104
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Cloud platform does not support runtime variables!')
105105
try {
106+
const originalWorkspaceId = variable.workspaceId
106107
const tmpUpdatedVariable = await appServer.AppDataSource.getRepository(Variable).merge(variable, updatedVariable)
107-
const originalWorkspaceId = variable.workspaceId;
108-
const tmpUpdatedVariable = await appServer.AppDataSource.getRepository(Variable).merge(variable, updatedVariable);
109-
tmpUpdatedVariable.workspaceId = originalWorkspaceId;
108+
tmpUpdatedVariable.workspaceId = originalWorkspaceId
110109
const dbResponse = await appServer.AppDataSource.getRepository(Variable).save(tmpUpdatedVariable)
111110
return dbResponse
112111
} catch (error) {

0 commit comments

Comments
 (0)