mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Mailchimp Trigger Node): Fix webhook recreation (#5328)
This commit is contained in:
committed by
GitHub
parent
78bbe2ba27
commit
8f5f1c3aa5
@@ -165,13 +165,8 @@ export class MailchimpTrigger implements INodeType {
|
||||
// select them easily
|
||||
async getLists(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
let lists, response;
|
||||
try {
|
||||
response = await mailchimpApiRequest.call(this, '/lists', 'GET');
|
||||
lists = response.lists;
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
}
|
||||
const response = await mailchimpApiRequest.call(this, '/lists', 'GET');
|
||||
const lists = response.lists;
|
||||
for (const list of lists) {
|
||||
const listName = list.name;
|
||||
const listId = list.id;
|
||||
@@ -200,8 +195,11 @@ export class MailchimpTrigger implements INodeType {
|
||||
try {
|
||||
await mailchimpApiRequest.call(this, endpoint, 'GET');
|
||||
} catch (error) {
|
||||
if (error.statusCode === 404) {
|
||||
return false;
|
||||
if (error instanceof NodeApiError && error.cause && 'isAxiosError' in error.cause) {
|
||||
if (error.cause.statusCode === 404) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user