mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Add name parameter to file:update to GoogleDrive (#2065)
This commit is contained in:
parent
afff86d9ae
commit
8998423934
|
@ -789,6 +789,13 @@ export class GoogleDrive implements INodeType {
|
||||||
his is only applicable to files with binary content in Google Drive.</br>
|
his is only applicable to files with binary content in Google Drive.</br>
|
||||||
Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.`,
|
Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Name',
|
||||||
|
name: 'name',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
description: `The name of the file`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'OCR Language',
|
displayName: 'OCR Language',
|
||||||
name: 'ocrLanguage',
|
name: 'ocrLanguage',
|
||||||
|
@ -2356,11 +2363,17 @@ export class GoogleDrive implements INodeType {
|
||||||
|
|
||||||
qs.fields = queryFields;
|
qs.fields = queryFields;
|
||||||
|
|
||||||
|
const body: IDataObject = {};
|
||||||
|
|
||||||
|
if (updateFields.name) {
|
||||||
|
body.name = updateFields.name;
|
||||||
|
}
|
||||||
|
|
||||||
if (updateFields.parentId && updateFields.parentId !== '') {
|
if (updateFields.parentId && updateFields.parentId !== '') {
|
||||||
qs.addParents = updateFields.parentId;
|
qs.addParents = updateFields.parentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
const responseData = await googleApiRequest.call(this, 'PATCH', `/drive/v3/files/${id}`, {}, qs);
|
const responseData = await googleApiRequest.call(this, 'PATCH', `/drive/v3/files/${id}`, body, qs);
|
||||||
returnData.push(responseData as IDataObject);
|
returnData.push(responseData as IDataObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue