mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Improvements
This commit is contained in:
parent
3090549ada
commit
b6fed1bc0d
|
@ -485,7 +485,8 @@ export class Dropbox implements INodeType {
|
||||||
let endpoint = '';
|
let endpoint = '';
|
||||||
let requestMethod = '';
|
let requestMethod = '';
|
||||||
let body: IDataObject | Buffer;
|
let body: IDataObject | Buffer;
|
||||||
let isJson = false;
|
let options;
|
||||||
|
const query: IDataObject = {};
|
||||||
|
|
||||||
const headers: IDataObject = {};
|
const headers: IDataObject = {};
|
||||||
|
|
||||||
|
@ -624,7 +625,7 @@ export class Dropbox implements INodeType {
|
||||||
options = { encoding: null };
|
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') {
|
if (resource === 'file' && operation === 'upload') {
|
||||||
responseData = JSON.parse(responseData);
|
responseData = JSON.parse(responseData);
|
||||||
|
|
|
@ -20,11 +20,12 @@ import {
|
||||||
* @param {object} body
|
* @param {object} body
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
export async function dropboxApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object, headers?: object, option: IDataObject = {}): Promise<any> {// 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<any> {// tslint:disable-line:no-any
|
||||||
|
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
headers,
|
headers,
|
||||||
method,
|
method,
|
||||||
|
qs: query,
|
||||||
body,
|
body,
|
||||||
uri: endpoint,
|
uri: endpoint,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
Loading…
Reference in a new issue