Skip to content

Commit

Permalink
fixup(Client): oops :( make _processAttachments return the expected s…
Browse files Browse the repository at this point in the history
…tructure (#8)

Also do not pass empty file arrays (triggers data being sent over as multipart data)
  • Loading branch information
TTtie authored Oct 23, 2022
1 parent 4456255 commit 0d6e138
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3136,7 +3136,7 @@ class Client extends EventEmitter {

_processAttachments(attachments) {
if(!attachments) {
return [];
return {};
}
const files = [];
const resultAttachments = [];
Expand All @@ -3158,7 +3158,10 @@ class Client extends EventEmitter {
}
});

return {files, resultAttachments};
return {
files: files.length ? files : undefined,
attachments: resultAttachments
};
}

toString() {
Expand Down

0 comments on commit 0d6e138

Please sign in to comment.