refactor(webhook): remove singleton webhook logic

This commit is contained in:
Ali BARIN
2025-01-13 16:11:29 +00:00
parent d688a97081
commit e4b31c7f52
5 changed files with 1 additions and 71 deletions

View File

@@ -1,5 +1,4 @@
import { URL } from 'node:url';
import get from 'lodash.get';
import Base from './base.js';
import App from './app.js';
import Flow from './flow.js';
@@ -109,25 +108,10 @@ class Step extends Base {
if (!triggerCommand) return null;
const { useSingletonWebhook, singletonWebhookRefValueParameter, type } =
triggerCommand;
const isWebhook = type === 'webhook';
const isWebhook = triggerCommand.type === 'webhook';
if (!isWebhook) return null;
if (singletonWebhookRefValueParameter) {
const parameterValue = get(
this.parameters,
singletonWebhookRefValueParameter
);
return `/webhooks/connections/${this.connectionId}/${parameterValue}`;
}
if (useSingletonWebhook) {
return `/webhooks/connections/${this.connectionId}`;
}
if (this.parameters.workSynchronously) {
return `/webhooks/flows/${this.flowId}/sync`;
}