mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
⚡ Additional fix to AWS SNS Trigger
This commit is contained in:
parent
ecb77926a4
commit
b40dec3e4a
|
@ -110,11 +110,18 @@ export class AwsSnsTrigger implements INodeType {
|
||||||
'Version=2010-03-31',
|
'Version=2010-03-31',
|
||||||
];
|
];
|
||||||
const data = await awsApiRequestSOAP.call(this, 'sns', 'GET', '/?Action=ListSubscriptionsByTopic&' + params.join('&'));
|
const data = await awsApiRequestSOAP.call(this, 'sns', 'GET', '/?Action=ListSubscriptionsByTopic&' + params.join('&'));
|
||||||
let subscriptions = get(data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions.member');
|
const subscriptions = get(data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions');
|
||||||
if (!Array.isArray(subscriptions)) {
|
if (!subscriptions || !subscriptions.member) {
|
||||||
subscriptions = [subscriptions];
|
return false;
|
||||||
}
|
}
|
||||||
for (const subscription of subscriptions) {
|
|
||||||
|
let subscriptionMembers = subscriptions.member;
|
||||||
|
|
||||||
|
if (!Array.isArray(subscriptionMembers)) {
|
||||||
|
subscriptionMembers = [subscriptionMembers];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const subscription of subscriptionMembers) {
|
||||||
if (webhookData.webhookId === subscription.SubscriptionArn) {
|
if (webhookData.webhookId === subscription.SubscriptionArn) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue