mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🐛 Fix issue when using any operation of the resource drive (#1818)
* 🐛 Fix issue when using any operation of the resource drive * 🐛 Remove console.log Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
2a7a87eb4d
commit
61937c52ba
|
@ -1970,7 +1970,6 @@ export class GoogleDrive implements INodeType {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// list
|
// list
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
||||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||||
|
|
||||||
const qs: IDataObject = {};
|
const qs: IDataObject = {};
|
||||||
|
@ -1986,6 +1985,7 @@ export class GoogleDrive implements INodeType {
|
||||||
const data = await googleApiRequest.call(this, 'GET', `/drive/v3/drives`, {}, qs);
|
const data = await googleApiRequest.call(this, 'GET', `/drive/v3/drives`, {}, qs);
|
||||||
response = data.drives as IDataObject[];
|
response = data.drives as IDataObject[];
|
||||||
}
|
}
|
||||||
|
|
||||||
returnData.push.apply(returnData, response);
|
returnData.push.apply(returnData, response);
|
||||||
}
|
}
|
||||||
if (operation === 'update') {
|
if (operation === 'update') {
|
||||||
|
@ -2004,7 +2004,8 @@ export class GoogleDrive implements INodeType {
|
||||||
returnData.push(response as IDataObject);
|
returnData.push(response as IDataObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (resource === 'file') {
|
}
|
||||||
|
if (resource === 'file') {
|
||||||
if (operation === 'copy') {
|
if (operation === 'copy') {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// copy
|
// copy
|
||||||
|
@ -2264,7 +2265,8 @@ export class GoogleDrive implements INodeType {
|
||||||
returnData.push(responseData as IDataObject);
|
returnData.push(responseData as IDataObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (resource === 'folder') {
|
}
|
||||||
|
if (resource === 'folder') {
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// folder:create
|
// folder:create
|
||||||
|
@ -2326,11 +2328,8 @@ export class GoogleDrive implements INodeType {
|
||||||
|
|
||||||
returnData.push(response as IDataObject);
|
returnData.push(response as IDataObject);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resource === 'file' && operation === 'download') {
|
if (resource === 'file' && operation === 'download') {
|
||||||
// For file downloads the files get attached to the existing items
|
// For file downloads the files get attached to the existing items
|
||||||
return this.prepareOutputData(items);
|
return this.prepareOutputData(items);
|
||||||
|
|
Loading…
Reference in a new issue