Skip to content

Commit 5fcdf97

Browse files
Ruben van LeeuwenDutchBen
authored andcommitted
Make it possible to start a task with pydantic forms
1 parent bd95222 commit 5fcdf97

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/orchestrator-ui-components/src/components/WfoPydanticForm/WfoPydanticForm.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,13 @@ export const WfoPydanticForm = ({
280280
requestBody = [],
281281
formKey,
282282
}) => {
283+
const userInputs = isTask
284+
? [...requestBody]
285+
: [{ ...startProcessPayload }, ...requestBody];
286+
283287
const response = startProcess({
284288
workflowName: formKey,
285-
userInputs: [{ ...startProcessPayload }, ...requestBody],
289+
userInputs,
286290
});
287291
return response
288292
.then(({ error, data }) => {
@@ -322,7 +326,7 @@ export const WfoPydanticForm = ({
322326
};
323327

324328
return pydanticFormProvider;
325-
}, [startProcess, startProcessPayload]);
329+
}, [isTask, startProcess, startProcessPayload]);
326330

327331
const handleCancel = useCallback(() => {
328332
const pfBasePath = isTask ? PATH_TASKS : PATH_WORKFLOWS;

0 commit comments

Comments
 (0)