mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,18 +1,8 @@
|
||||
import {
|
||||
IHookFunctions,
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IHookFunctions, IWebhookFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IWebhookResponseData,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
mailerliteApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { mailerliteApiRequest } from './GenericFunctions';
|
||||
|
||||
export class MailerLiteTrigger implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -101,7 +91,7 @@ export class MailerLiteTrigger implements INodeType {
|
||||
{
|
||||
name: 'Subscriber Updated',
|
||||
value: 'subscriber.update',
|
||||
description: 'Fired when any of the subscriber\'s custom fields are updated',
|
||||
description: "Fired when any of the subscriber's custom fields are updated",
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
@@ -123,8 +113,7 @@ export class MailerLiteTrigger implements INodeType {
|
||||
const endpoint = '/webhooks';
|
||||
const { webhooks } = await mailerliteApiRequest.call(this, 'GET', endpoint, {});
|
||||
for (const webhook of webhooks) {
|
||||
if (webhook.url === webhookUrl &&
|
||||
webhook.event === event) {
|
||||
if (webhook.url === webhookUrl && webhook.event === event) {
|
||||
// Set webhook-id to be sure that it can be deleted
|
||||
webhookData.webhookId = webhook.id as string;
|
||||
return true;
|
||||
@@ -157,7 +146,6 @@ export class MailerLiteTrigger implements INodeType {
|
||||
async delete(this: IHookFunctions): Promise<boolean> {
|
||||
const webhookData = this.getWorkflowStaticData('node');
|
||||
if (webhookData.webhookId !== undefined) {
|
||||
|
||||
const endpoint = `/webhooks/${webhookData.webhookId}`;
|
||||
|
||||
try {
|
||||
@@ -181,9 +169,7 @@ export class MailerLiteTrigger implements INodeType {
|
||||
const events = body.events as IDataObject[];
|
||||
|
||||
return {
|
||||
workflowData: [
|
||||
this.helpers.returnJsonArray(events),
|
||||
],
|
||||
workflowData: [this.helpers.returnJsonArray(events)],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user