feat(Microsoft OneDrive Node): Add rename option for files and folders (#3224)

This commit is contained in:
Jonathan Bennetts
2022-05-15 18:55:09 +01:00
committed by GitHub
parent d8870ecbff
commit 50246d174a
3 changed files with 93 additions and 0 deletions

View File

@@ -271,6 +271,15 @@ export class MicrosoftOneDrive implements INodeType {
returnData.push(responseData);
}
}
if (resource === 'file' || resource === 'folder') {
if (operation === 'rename') {
const itemId = this.getNodeParameter('itemId', i) as string;
const newName = this.getNodeParameter('newName', i) as string;
const body = {name: newName};
responseData = await microsoftApiRequest.call(this, 'PATCH', `/drive/items/${itemId}`, body);
returnData.push(responseData as IDataObject);
}
}
} catch (error) {
if (this.continueOnFail()) {
if (resource === 'file' && operation === 'download') {