Minor improvements to ConvertKit-Node

This commit is contained in:
Jan Oberhauser
2020-08-25 23:16:38 +02:00
parent 8da0f6af4a
commit 426f0ae784
3 changed files with 14 additions and 20 deletions

View File

@@ -5,11 +5,11 @@ import {
import {
IDataObject,
ILoadOptionsFunctions,
INodePropertyOptions,
INodeTypeDescription,
INodeType,
IWebhookResponseData,
ILoadOptionsFunctions,
INodePropertyOptions,
} from 'n8n-workflow';
import {
@@ -266,7 +266,7 @@ export class ConvertKitTrigger implements INodeType {
// THe API does not have an endpoint to list all webhooks
if(webhookData.webhookId) {
if (webhookData.webhookId) {
return true;
}
@@ -282,11 +282,8 @@ export class ConvertKitTrigger implements INodeType {
const endpoint = '/automations/hooks';
if (event === 'purchaseCreate') {
event = `purchase.${snakeCase(event)}`;
} else {
event = `subscriber.${snakeCase(event)}`;
}
@@ -344,11 +341,8 @@ export class ConvertKitTrigger implements INodeType {
const endpoint = `/automations/hooks/${webhookData.webhookId}`;
try {
await convertKitApiRequest.call(this, 'DELETE', endpoint);
} catch (error) {
return false;
}