Add name parameter to file:update to GoogleDrive (#2065)

This commit is contained in:
Ricardo Espinoza 2021-08-11 13:37:18 -04:00 committed by GitHub
parent afff86d9ae
commit 8998423934
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
} }