fix(AWS SQS Node): Fix issue preventing data from being sent correctly (#8382)

This commit is contained in:
Jon 2024-01-19 11:28:41 +00:00 committed by GitHub
parent e606e841ee
commit daba5bb250
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -296,10 +296,16 @@ export class AwsSqs implements INodeType {
const options = this.getNodeParameter('options', i, {}); const options = this.getNodeParameter('options', i, {});
const sendInputData = this.getNodeParameter('sendInputData', i) as boolean; const sendInputData = this.getNodeParameter('sendInputData', i) as boolean;
const message = sendInputData let message = sendInputData
? JSON.stringify(items[i].json) ? JSON.stringify(items[i].json)
: (this.getNodeParameter('message', i) as string); : this.getNodeParameter('message', i);
params.push(`MessageBody=${message}`);
// This prevents [object Object] from being sent as message when sending json in an expression
if (typeof message === 'object') {
message = JSON.stringify(message);
}
params.push(`MessageBody=${encodeURIComponent(message as string)}`);
if (options.delaySeconds) { if (options.delaySeconds) {
params.push(`DelaySeconds=${options.delaySeconds}`); params.push(`DelaySeconds=${options.delaySeconds}`);