diff --git a/packages/plugins/@nocobase/plugin-workflow-manual/src/server/__tests__/form.test.ts b/packages/plugins/@nocobase/plugin-workflow-manual/src/server/__tests__/form.test.ts index 37d3422b4a..1811fcb44d 100644 --- a/packages/plugins/@nocobase/plugin-workflow-manual/src/server/__tests__/form.test.ts +++ b/packages/plugins/@nocobase/plugin-workflow-manual/src/server/__tests__/form.test.ts @@ -183,7 +183,7 @@ describe('workflow > instructions > manual', () => { expect(job.result).toEqual({ f1: { a: 2 }, _: 'resolve' }); }); - it('values rejected will not be overrided by action assigned', async () => { + it('values rejected will be overrided by action assigned', async () => { const n1 = await workflow.createNode({ type: 'manual', config: { @@ -230,7 +230,7 @@ describe('workflow > instructions > manual', () => { expect(execution.status).toBe(EXECUTION_STATUS.REJECTED); const [job] = await execution.getJobs(); expect(job.status).toBe(JOB_STATUS.REJECTED); - expect(job.result).toEqual({ f1: { a: 1 }, _: 'reject' }); + expect(job.result).toEqual({ f1: { a: 2 }, _: 'reject' }); }); it('values saved as pending will not be overrided by action assigned', async () => { diff --git a/packages/plugins/@nocobase/plugin-workflow-manual/src/server/actions.ts b/packages/plugins/@nocobase/plugin-workflow-manual/src/server/actions.ts index 3a04e1d057..24770ce3ae 100644 --- a/packages/plugins/@nocobase/plugin-workflow-manual/src/server/actions.ts +++ b/packages/plugins/@nocobase/plugin-workflow-manual/src/server/actions.ts @@ -84,10 +84,9 @@ export async function submit(context: Context, next) { userJob.set({ status: actionItem.status, - result: - actionItem.status > JOB_STATUS.PENDING - ? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey } - : Object.assign(userJob.result ?? {}, values.result), + result: actionItem.status + ? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey } + : Object.assign(userJob.result ?? {}, values.result), }); const handler = instruction.formTypes.get(forms[formKey].type);