mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(Calendly Trigger Node): Fix issue with webhook url matching (#10378)
This commit is contained in:
@@ -116,7 +116,7 @@ export class CalendlyTrigger implements INodeType {
|
|||||||
async checkExists(this: IHookFunctions): Promise<boolean> {
|
async checkExists(this: IHookFunctions): Promise<boolean> {
|
||||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||||
const webhookData = this.getWorkflowStaticData('node');
|
const webhookData = this.getWorkflowStaticData('node');
|
||||||
const events = this.getNodeParameter('events') as string;
|
const events = this.getNodeParameter('events') as string[];
|
||||||
|
|
||||||
const authenticationType = await getAuthenticationType.call(this);
|
const authenticationType = await getAuthenticationType.call(this);
|
||||||
|
|
||||||
@@ -160,16 +160,14 @@ export class CalendlyTrigger implements INodeType {
|
|||||||
const { collection } = await calendlyApiRequest.call(this, 'GET', endpoint, {}, qs);
|
const { collection } = await calendlyApiRequest.call(this, 'GET', endpoint, {}, qs);
|
||||||
|
|
||||||
for (const webhook of collection) {
|
for (const webhook of collection) {
|
||||||
if (webhook.callback_url === webhookUrl) {
|
if (
|
||||||
for (const event of events) {
|
webhook.callback_url === webhookUrl &&
|
||||||
if (!webhook.events.includes(event)) {
|
events.length === webhook.events.length &&
|
||||||
return false;
|
events.every((event: string) => webhook.events.includes(event))
|
||||||
}
|
) {
|
||||||
}
|
webhookData.webhookURI = webhook.uri;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
webhookData.webhookURI = webhook.uri;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +176,7 @@ export class CalendlyTrigger implements INodeType {
|
|||||||
async create(this: IHookFunctions): Promise<boolean> {
|
async create(this: IHookFunctions): Promise<boolean> {
|
||||||
const webhookData = this.getWorkflowStaticData('node');
|
const webhookData = this.getWorkflowStaticData('node');
|
||||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||||
const events = this.getNodeParameter('events') as string;
|
const events = this.getNodeParameter('events') as string[];
|
||||||
|
|
||||||
const authenticationType = await getAuthenticationType.call(this);
|
const authenticationType = await getAuthenticationType.call(this);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user