refactor: use functional app implementation

This commit is contained in:
Ali BARIN
2022-10-06 23:27:37 +02:00
committed by Faruk AYDIN
parent 89d7359060
commit e7b47f5c98
9 changed files with 72 additions and 50 deletions

View File

@@ -97,12 +97,8 @@ class Step extends Base {
const { appKey, key } = this;
const connection = await this.$relatedQuery('connection');
const flow = await this.$relatedQuery('flow');
const AppClass = (await import(`../apps/${appKey}`)).default;
const appInstance = new AppClass(connection, flow, this);
const command = appInstance.triggers[key];
const app = await App.findOneByKey(appKey);
const command = app.triggers.find((trigger) => trigger.key === key);
return command;
}