refactor: Optimize fetching last execution step

This commit is contained in:
Faruk AYDIN
2023-06-05 23:00:35 +02:00
parent 9f759d70b6
commit 6a92cfc573
5 changed files with 23 additions and 21 deletions

View File

@@ -8,12 +8,14 @@ export default defineTrigger({
description: 'Triggers when the webhook receives a request.',
async testRun($) {
if (!isEmpty($.lastExecutionStep?.dataOut)) {
const lastExecutionStep = await $.getLastExecutionStep();
if (!isEmpty(lastExecutionStep?.dataOut)) {
$.pushTriggerItem({
raw: $.lastExecutionStep.dataOut,
raw: lastExecutionStep.dataOut,
meta: {
internalId: '',
}
},
});
}
},