fix: Fetch connection while getting trigger for step

This commit is contained in:
Faruk AYDIN
2022-05-13 12:48:21 +02:00
parent f9fa7c4094
commit fad2495941

View File

@@ -84,14 +84,16 @@ class Step extends Base {
async getTrigger() {
if (!this.isTrigger) return null;
const { appKey, connection, key, parameters = {} } = this;
const { appKey, key, parameters = {} } = this;
const connection = await this.$relatedQuery('connection');
const appData = App.findOneByKey(appKey);
const AppClass = (await import(`../apps/${appKey}`)).default;
const appInstance = new AppClass(
appData,
connection?.formattedData,
parameters,
parameters
);
const command = appInstance.triggers[key];