From 0b6ecafa9de63a3e1f06ea7468e6b340fe5f759c Mon Sep 17 00:00:00 2001 From: Guilherme Caponetto <638737+caponetto@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:53:09 -0300 Subject: [PATCH] fix(orchestrator): filter out undefined/null values from action input --- plugins/orchestrator-backend/src/service/router.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/orchestrator-backend/src/service/router.ts b/plugins/orchestrator-backend/src/service/router.ts index 952ef3900e..fc5082e2f6 100644 --- a/plugins/orchestrator-backend/src/service/router.ts +++ b/plugins/orchestrator-backend/src/service/router.ts @@ -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); });