Junyi 6c19dad23d
chore(plugin-workflow): adjust types (#2206)
* chore(plugin-workflow): adjust types

* fix(plugin-workflow): fix types
2023-07-07 02:59:46 -07:00

24 lines
626 B
TypeScript

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