Junyi 8ee8ab7d6d
refactor(plugin-workflow): refactor apis (#3267)
* refactor(plugin-workflow): refactor apis

* fix(plugin-workflow-parallel): fix import in test cases

* fix(plugin-workflow): fix some module import source

* fix(plugin-workflow): move manual table acl to manual plugin

* fix(plugin-workflow-manual): fix folder typo
2023-12-27 13:55:48 +08:00

28 lines
790 B
TypeScript

import { Instruction } from '.';
import type Processor from '../Processor';
import { JOB_STATUS } from '../constants';
import type { FlowNodeModel } from '../types';
export class DestroyInstruction extends Instruction {
async run(node: FlowNodeModel, input, processor: Processor) {
const { collection, params = {} } = node.config;
const repo = (<typeof FlowNodeModel>node.constructor).database.getRepository(collection);
const options = processor.getParsedValue(params, node.id);
const result = await repo.destroy({
...options,
context: {
executionId: processor.execution.id,
},
// transaction: processor.transaction,
});
return {
result,
status: JOB_STATUS.RESOLVED,
};
}
}
export default DestroyInstruction;