Added create folder operation

This commit is contained in:
ricardo
2020-03-29 22:39:43 -04:00
parent fc5df1e294
commit 79fda65e7e
3 changed files with 112 additions and 0 deletions

View File

@@ -193,6 +193,16 @@ export class MicrosoftOneDrive implements INodeType {
}
}
if (resource === 'folder') {
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_post_children?view=odsp-graph-online
if (operation === 'create') {
const name = this.getNodeParameter('name', i) as string;
const body: IDataObject = {
name,
folder: {},
};
responseData = await microsoftApiRequest.call(this, 'POST', '/drive/root/children', body);
returnData.push(responseData);
}
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_children?view=odsp-graph-online
if (operation === 'getChildren') {
const folderId = this.getNodeParameter('folderId', i) as string;