mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
* 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
28 lines
790 B
TypeScript
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;
|