From b6fed1bc0d9343017128c0e2ca20a70a57601e60 Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 23 Jul 2020 21:20:21 -0400 Subject: [PATCH] :zap: Improvements --- packages/nodes-base/nodes/Dropbox/Dropbox.node.ts | 5 +++-- packages/nodes-base/nodes/Dropbox/GenericFunctions.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts b/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts index 62faf1a67e..6e05fa5c58 100644 --- a/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts +++ b/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts @@ -485,7 +485,8 @@ export class Dropbox implements INodeType { let endpoint = ''; let requestMethod = ''; let body: IDataObject | Buffer; - let isJson = false; + let options; + const query: IDataObject = {}; const headers: IDataObject = {}; @@ -624,7 +625,7 @@ export class Dropbox implements INodeType { options = { encoding: null }; } - let responseData = await dropboxApiRequest.call(this, requestMethod, endpoint, body, headers, options); + let responseData = await dropboxApiRequest.call(this, requestMethod, endpoint, body, query, headers, options); if (resource === 'file' && operation === 'upload') { responseData = JSON.parse(responseData); diff --git a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts index c66a615bb8..bf24762df3 100644 --- a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts @@ -20,11 +20,12 @@ import { * @param {object} body * @returns {Promise} */ -export async function dropboxApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object, headers?: object, option: IDataObject = {}): Promise {// tslint:disable-line:no-any +export async function dropboxApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object, query: IDataObject = {}, headers?: object, option: IDataObject = {}): Promise {// tslint:disable-line:no-any const options: OptionsWithUri = { headers, method, + qs: query, body, uri: endpoint, json: true,