mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
registered GET method
This commit is contained in:
@@ -36,12 +36,18 @@ export class MailchimpTrigger implements INodeType {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
webhooks: [
|
webhooks: [
|
||||||
{
|
{
|
||||||
name: 'default',
|
name: 'setup',
|
||||||
httpMethod: 'POST',
|
httpMethod: 'GET',
|
||||||
reponseMode: 'onReceived',
|
reponseMode: 'onReceived',
|
||||||
path: 'webhook',
|
path: 'webhook',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'default',
|
||||||
|
httpMethod: 'POST',
|
||||||
|
reponseMode: 'onReceived',
|
||||||
|
path: 'webhook',
|
||||||
|
}
|
||||||
],
|
],
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
@@ -229,6 +235,15 @@ export class MailchimpTrigger implements INodeType {
|
|||||||
|
|
||||||
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
|
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
|
||||||
const webhookData = this.getWorkflowStaticData('node') as IDataObject;
|
const webhookData = this.getWorkflowStaticData('node') as IDataObject;
|
||||||
|
const webhookName = this.getWebhookName();
|
||||||
|
if (webhookName === 'setup') {
|
||||||
|
// Is a create webhook confirmation request
|
||||||
|
const res = this.getResponseObject();
|
||||||
|
res.status(200).end();
|
||||||
|
return {
|
||||||
|
noWebhookResponse: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
const req = this.getRequestObject();
|
const req = this.getRequestObject();
|
||||||
if (req.body.id !== webhookData.id) {
|
if (req.body.id !== webhookData.id) {
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
Reference in New Issue
Block a user