mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00: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:
@@ -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
|
||||||
@@ -2026,7 +2027,7 @@ export class GoogleDrive implements INodeType {
|
|||||||
const qs = {
|
const qs = {
|
||||||
supportsAllDrives: true,
|
supportsAllDrives: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await googleApiRequest.call(this, 'POST', `/drive/v3/files/${fileId}/copy`, body, qs);
|
const response = await googleApiRequest.call(this, 'POST', `/drive/v3/files/${fileId}/copy`, body, qs);
|
||||||
|
|
||||||
returnData.push(response as IDataObject);
|
returnData.push(response as IDataObject);
|
||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user