Skip to content

Commit

Permalink
fix(AWS SQS Node): Fix issue preventing data from being sent correctly (
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffcom authored Jan 19, 2024
1 parent e606e84 commit daba5bb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,16 @@ export class AwsSqs implements INodeType {
const options = this.getNodeParameter('options', i, {});
const sendInputData = this.getNodeParameter('sendInputData', i) as boolean;

const message = sendInputData
let message = sendInputData
? JSON.stringify(items[i].json)
: (this.getNodeParameter('message', i) as string);
params.push(`MessageBody=${message}`);
: this.getNodeParameter('message', i);

// 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) {
params.push(`DelaySeconds=${options.delaySeconds}`);
Expand Down

0 comments on commit daba5bb

Please sign in to comment.