Skip to content

Commit

Permalink
fix(orchestrator): filter out null values from action input (#1199)
Browse files Browse the repository at this point in the history
fix(orchestrator): filter out undefined/null values from action input
  • Loading branch information
caponetto authored Feb 13, 2024
1 parent 9731671 commit 55c3927
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/orchestrator-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,17 @@ function setupExternalRoutes(
const { actionId } = req.params;
const instanceId: string | undefined = req.header('kogitoprocinstanceid');
const body: JsonObject = (await req.body) as JsonObject;

const filteredBody = Object.fromEntries(
Object.entries(body).filter(
([, value]) => value !== undefined && value !== null,
),
);

const result: JsonValue = await scaffolderService.executeAction({
actionId,
instanceId,
input: body,
input: filteredBody,
});
res.status(200).json(result);
});
Expand Down

0 comments on commit 55c3927

Please sign in to comment.