Skip to content

Commit

Permalink
formData refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitdas13 committed May 15, 2024
1 parent 35de20e commit 2fb2353
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/resources/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ module.exports = function (api) {
},

uploadAccountDoc(accountId, params, callback) {
let {file, ...rest} = params
return api.postFormData({
version: 'v2',
url: `${BASE_URL}/${accountId}/documents`,
formData: params
formData: {
file: file.value, ...rest
}
}, callback);
},

Expand Down
5 changes: 4 additions & 1 deletion lib/resources/stakeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ module.exports = function (api) {
},

uploadStakeholderDoc(accountId, stakeholderId, params, callback) {
let {file, ...rest} = params
return api.postFormData({
version: 'v2',
url: `${BASE_URL}/${accountId}/stakeholders/${stakeholderId}/documents`,
formData: params
formData: {
file: file.value, ...rest
}
}, callback);
},

Expand Down

0 comments on commit 2fb2353

Please sign in to comment.