mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -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',
|
||||
];
|
||||
const data = await awsApiRequestSOAP.call(this, 'sns', 'GET', '/?Action=ListSubscriptionsByTopic&' + params.join('&'));
|
||||
let subscriptions = get(data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions.member');
|
||||
if (!Array.isArray(subscriptions)) {
|
||||
subscriptions = [subscriptions];
|
||||
const subscriptions = get(data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions');
|
||||
if (!subscriptions || !subscriptions.member) {
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue