Skip to content

Commit

Permalink
fix: node output data type
Browse files Browse the repository at this point in the history
  • Loading branch information
horpeazy committed May 27, 2024
1 parent 6b2b0c8 commit 0c4ff86
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/cli/src/workflowTests/workflowTests.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ export class WorkflowTestsController {
throw new BadRequestError('Workflow Test not found');
}

return Container.get(WorkflowTestService).getNodesOutput(req.params.workflowTestId);
const result = Container.get(WorkflowTestService).getNodesOutput(req.params.workflowTestId);
const nodesOuput = result?.map((output) => {
try {output.data = JSON.parse(output.data)} catch(e){};
return output
})
return nodesOuput;
}

@Post('/nodes-output/:workflowTestId')
Expand Down Expand Up @@ -138,7 +143,7 @@ export class WorkflowTestsController {
id: nodeOutputId,
workflowTestId: req.body.workflowTestId,
nodeId: req.body.nodeId,
data: req.body.outputType === 'data' ? req.body.data : {},
data: req.body.outputType === 'data' ? JSON.stringify(req.body.data) : '[]',
errorMessage: req.body.outputType === 'error' ? req.body.errorMessage : '',
};
const nodeKey = {
Expand Down

0 comments on commit 0c4ff86

Please sign in to comment.